-
Notifications
You must be signed in to change notification settings - Fork 0
Validator
Mehdi Bounya edited this page Jul 14, 2018
·
2 revisions
The \PHPForms\Validator()
class is used to validate data.
- Arguments:
-
\PHPForms\Form $form
: TheForm
object. -
array $data
: Data to be validated, you will usually want to pass the$_POST
array here. -
\PHPForms\Validation $validations
: This should be a class that extends the abstractValidation
class, it must contain all the rules used by the Form. You can pass the\PHPForms\Validations()
class that already comes with PHPForms or make your own.
-
- Returns: bool
Check if the passed data is valid, returns TRUE if valid or FALSE otherwise.
- Returns: array
Returns an array of data that passed the validation rules, this method must be called after calling isValid()
- Returns: array
Returns an array of validation errors, this method must be called after calling isValid()