That's pretty much all accurate.  Form validation is still somewhat of
a work-in-progress in 1.2, and displaying errors will be handled by
FormHelper::error() once the implementation is finished (it is already
used in FormHelper::input()), at which time HtmlHelper::tagErrorMsg()
will be deprecated.

On Feb 18, 3:05 am, "GreyCells" <[EMAIL PROTECTED]> wrote:
> The way it appears to work now (I'm sure nate will correct me if I'm
> wrong) is to put your error messages in the model. Here is an example
> of an email validation:
>
> var $validate = array(
>          'email_address' => array( array('allowEmpty' => false
>                 ,'message' => 'Invalid email address format or unknown
> domain')
>                 , 'rule' => array('email', true)
>         ),
> );
>
> Note the 'message' element in the array. It will also display the
> second argument of $Model->invalidate('field_name', 'My custom
> message'); if you happen to be doing stuff in $Model->validates()
>
> Use the $form->input() 'wrapper' and the error messages will be
> rendered automatically without having to call tagErrorMessage i.e.
> this is all you need in your view:
>
> <?php echo $form->input('email_address', array('class' =>
> 'required'));?>
>
> On Feb 18, 4:12 am, "gobblez" <[EMAIL PROTECTED]> wrote:
>
> > Hello, in the latest 1.2 SVN,  I can't get validation to work.  Well,
> > it is working, the empty fields are being flagged as they should be
> > for not meeting cake's regex constants, but my tagErrorMsg definitions
> > aren't spitting out their messages.
>
> > I did a search, and found it on line 1685 of model.php  What I did, is
> > changed 'This field cannot be left blank' to '1'.  It works now, but
> > I'm thinking maybe tagErrorMsg is used differently now.
>
> > Here is an example of how I've been using it, and it works when a
> > flagged field is set to '1' instead of that 'this field cannot..."
> > sentence.
>
> > echo $html->tagErrorMsg('User/username', '<span class="error">Please
> > enter a username.</span><br />');


--~--~---------~--~----~------------~-------~--~----~
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