webCOMAND

validate::validation_errors()

Return array of validation error strings for all invalid values.

Prototype

array validation_errors()

Return

Returns an array of strings of validation errors.

Example

$validate = new \io_comand_web\validate();
$validate->request('email',
    ['trim', 'required', 'email'],
    'Invalid email address'
);
if($validate->valid()) {
    return TRUE;
}
foreach($validate->validation_errors() as $error) {
    echo("Error: $error\n");
}

Related

valid()