Client-side validation helps users and reduces invalid submissions to the server. Server-side validation protects the users, the application, and the server. Server-side validation is a must, but if you want to use client-side validation, how can you sync the validation constraints?

We'll begin by discussing the differences between client and server-side validation; then, we'll cover how you can synchronize the validation between the client and server to help users and ensure valid data is sent to the server. The first approach will demonstrate the use of straight PHP, using an .ini file as the source for the validation constraints. The next method will use it with Symfony form field attributes and finally synchronized validation with Doctrine ORM annotations will be demonstrated.

Comments

Comments are closed.

Chuck Burgess at 15:20 on 31 May 2018

Good explanations and examples.

Brian Sanders at 15:21 on 31 May 2018

Neat idea. Sort of a Naked Objects pattern with HTML 5 form validation constraints as the generated UI. Good pacing and delivery for the talk.