This class can validate forms according to rules defined in JSON.
It takes a string encoded in JSON format that defines the fields, submitted and rules to validate a form.
The class supports several types of field validation: required, number, email, phone numbers, English or Russian text, etc..
The validation can be performed and end when one invalid field is found or validate all fields at once.
The class performs the defined validations and returns the the results also as a JSON encoded string with all the invalid fields and the respective error messages. |