pajama icon indicating copy to clipboard operation
pajama copied to clipboard

Custom error messages in Pajama

Open amorellp opened this issue 10 years ago • 0 comments

Hi! Is there an equivalent to jquery validation plugin 's message field in Pajama? Something like:

\Pajama\Validator::validate(array( 'model' => $_POST, 'rules' => array( 'first_name' => 'required', 'last_name' => 'required', ), 'messages': { 'first_name' => 'Enter the first name', 'last_name' => 'Enter the last name', } ));

I am trying to use Pajama, but one of my requirements is that form validation works both with javascript enable and disable. With Pajama it is this way, except for the error messages. I do not find a clean way to detect which rules has failed in order to create a proper error message. Greetings, Alberto Morell.

amorellp avatar Nov 17 '14 08:11 amorellp