Yes, indeed it's the correct MVC way ..However, in case of multiple
views it's convenient to be able to set the messages in model (I know,
it breaks a bit the MVC rules)...
On Jan 7, 1:20 pm, "Amit Badkas" <[EMAIL PROTECTED]> wrote:
> The correct way to show error message is like, in view, <?php echo
> $form->input('username', array('error' => array('alphanumeric' =>
> __('Username must contain alpha-numeric characters', true), 'between' =>
> __('Username must be between 8 to 20 characters', true)))); ?>
>
> On Jan 5, 2008 5:12 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > I have setup some 1.2 beta validation rules with the message key, but
> > this throws and error. Any idea?
>
> > Here is the piece from my model...
>
> > public $validate = array(
> > 'username' => array(
> > 'alphanumeric' => array(
> > 'rule' => 'alphaNumeric',
> > 'message' => __('error_username', true)
> > ),
> > 'between' => array(
> > 'rule' => array('between', 8, 20),
> > 'message' => __('error_username_between', true)
> > ),
> > ),
>
> > And here is the error...
>
> > Parse error: syntax error, unexpected '(', expecting ')' in /home/
> > username/public_html/cake12/app/models/users.php on line 12
>
> --
> Regards,
> Amit
>
> http://amitrb.wordpress.com/http://coppermine-gallery.net/http://cheesecake-photoblog.org/http://www.sanisoft.com/blog/author/amitbadkas
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---