Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom error messages in Pajama #2

Open
amorellp opened this issue Nov 17, 2014 · 0 comments
Open

Custom error messages in Pajama #2

amorellp opened this issue Nov 17, 2014 · 0 comments

Comments

@amorellp
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant