Thanks for answering.

I do this because I need to translate the messages of validation. I
found this method in the book and also cake "bakers":

http://book.cakephp.org/view/133/Multiple-Rules-per-Field (In the end)
http://bakery.cakephp.org/articles/view/multiple-rules-of-validation-per-field-in-cakephp-1-2

How else can I translate the custom messages of validation?

Tranks

On 17 dic, 02:07, peterchenadded <peterchenad...@gmail.com> wrote:
> I believe you can only include one default error message using the
> form helper. It is not possible to include more than one. Which would
> be the reason the 'unique' message is not showing as it is simply
> ignored.
>
> Please see below to get your validation errors working
>
> In your model:
>
> var $validate = array(
>   'username' => array(
>     'between' => array(
>       'rule' => array('between', 4, 10),
>       'message' => 'username must be between 4 and 10',
>       'last' => true,
>       'required' => true
>     ),
>     'unique' => array(
>       'rule' => 'isUnique',
>       'message' => 'username already exists'
>     )
>   )
> );
>
> In your view:
>
> <?php echo $form->input('username'); ?>

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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to