Just a hint try to add "rule" => before "VALID_NO _EMPTY" and
"message" => before the message

Hope this helps

On Sep 16, 7:00 pm, 1Marc <[EMAIL PROTECTED]> wrote:
> I'm looking for a good way to add multiple validation rules each with
> its own error message.
>
> I'm looking at doing something like the following in the Module:
>
> class User extends AppModel
> {
>         var $name = 'User';
>
>         var $validate = array(
>                'uname' => array(
>                         array(VALID_NOT_EMPTY, 'Username is Required'),
>                         array(VALID_INVALID_CHARS, 'Username contains invalid 
> characters'),
>                         array(VALID_UNIQUE, 'Username must be unique, try 
> adding numbers to
> your name')
>                 ),
>                'lname' => array(
>                         array(VALID_NOT_EMPTY, 'Last Name is Required'),
>                         array(VALID_INVALID_CHARS, 'Last Name contains 
> invalid characters')
>                 )
>         );
>
> }
>
> Has anybody seen anything like this that works?


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to