On Dec 29, 2010, at 11:24, john lyles wrote:
> If your form looked something like this you would get the result you
> are looking for:
> echo $this->Form->input('username', array('error' =>
> $this->data['User']['username'] . ' is taken'));
And of course if you wanted that to be localizable:
echo $this->Form->input('username', array('error' => sprintf(__('%s is taken',
true), $this->data['User']['username'])));
But wouldn't this error message be displayed when *any* validation error with
the username field occurs? What if I also have validation checks for whether
it's empty, whether it's too short, whether it includes invalid characters?
Anyway, wouldn't I want to specify validation errors in the controller, not in
the view?
Check out the new CakePHP Questions site http://cakeqs.org and help others with
their CakePHP related questions.
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en