Upgrade to Pro — share decks privately, control downloads, hide ads and more …

InspringCon Lightning Talk - Frontend Form Validation

InspringCon Lightning Talk - Frontend Form Validation

I present an idea how to automate frontend form validation in the Neos Flow PHP Framework by exposing the Validators defined on an entity to the frontend.

E3a43e2c588568daf6e1c873449df6a0?s=128

Bastian Heist

April 23, 2016
Tweet

More Decks by Bastian Heist

Other Decks in Programming

Transcript

  1. Form Validation!

  2. Here’s an idea…

  3. Expose the backend validators to automatically validate forms in the

    frontend, too
  4. Browser Flow Form <f:form object=“{entity}” …> <f:form.textfield property=“email” … />

    </f:form> 
 /**
 * @Flow\Entity
 */
 class User
 {
 /**
 * @var string
 * @Flow\Validate(type="NotEmpty")
 * @Flow\Validate(type="EmailAddress")
 */
 protected $email; … } <script>autogenerated JS to
 validate a form field</script> Validation Endpoint
  5. // TODO

  6. Thank you! @beheist bastian.heist@sandstorm.de