Multiple Rules is only available in Cake 1.2. There is a Bakery article on this : http://bakery.cakephp.org/articles/view/multiple-rules-of-validation-per-field-in-cakephp-1-2
I also wrote two posts on the new Validation in 1.2 on my blog http://lemoncake.wordpress.com/2007/07/03/all-about-validation-in-cakephp-12/ http://lemoncake.wordpress.com/2007/07/06/all-about-validation-in-cakephp-12-part-2/ Geoff -- http://lemoncake.wordpress.com On Sep 17, 8:54 am, francky06l <[EMAIL PROTECTED]> wrote: > 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 -~----------~----~----~----~------~----~------~--~---
