I created a bunch of errors in the file under APPPATH/messages/validate.phpwith a bunch of generic messages like ...
return array(
'not_empty' => ':field must not be empty.',
'matches' => ':field must be the same as :param1',
'regex' => ':field does not match the required format',
'exact_length' => ':field must be exactly :param1 characters long',
'min_length' => ':field must be at least :param1 characters long',
'max_length' => ':field must be less than :param1 characters long',
'in_array' => ':field must be one of the available options',
'digit' => ':field must be a digit',
'email' => 'You must enter a valid email.',
'name' => 'You must enter your name.',
'enquiry' => 'You must enter your enquiry.',
'captcha' => array (
'Captcha::valid' => 'The characters you entered did not match the image. Please try again.',
'not_empty' => 'You must enter the characters from the image.'
)
);
This works great when I get errors like $errors = $post->errors('validate').
Is there a way to use these errors as basic errors, and if I have a separate form that needs more, I can use a separate file with only differences in it, for example, it may look like
return array(
'permissions' => 'Please agree to the permissions',
);
Obviously, any error message emailwill be received from validate.php(inherited), but any error permissionswill be received from the new file with the error definition for permissions.
validate.php, , , system, , SYSPATH/messages/validate.php (. GitHub).
?