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

Transcript

  1. 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
  2. 5.