Class Validator

Form fields and administration grid data validation

Namespace: Ip\Form


__construct( [ array $data = array() ] , [ string $errorMessage = null ] )

All validators has to have the same constructor to make it easier to use them

Thanks to this rule, you can add new validator to the form field without actually creating validator object, but just passing validator class and data for the constructor. Eg. $field->addValidator('validatorClass', $validationData);


array $data additional parameters to tune up the validator. Like regular expression for Regex validator.
string $errorMessage Override default error message.
getError( array $values , string $valueKey , string $environment )

Return false on success or string on error

Add extra params at the end if you need.


array $values
string $valueKey
string $environment \Ip\Form::ENVIRONMENT_ADMIN or \Ip\Fomr::ENVIRONEMNT_PUBLIC
string validatorAttributes( )

jQuery tools compatible validation arguments

Return values:

comments powered by Disqus