model:

'author_name' => array(
        'required' => array(
                'rule' => 'validateNotEmpty'
        )
),

view:

<?php echo $form->error('author_name',
array('required'=>__('validation_required', true))) ?>

gbk

On jún. 19, 20:03, Vlad <[EMAIL PROTECTED]> wrote:
> Thank you. Worked like a charm.
>
> I have another question though, related to errors. In the cookbook it
> says that if you want to use error messages using L10n, then you need
> to define them in the view, on the 'error' option of the field. The
> problem is, when I do this the only thing that happens is that an
> error attribute is created in the tag with the error message as a
> value, like <p error="Message">. Because of this I was forced to
> define the messages in the model in English even though it would be my
> wish to give localized errors. Any idea on why this happens?
>
> Thank you.
>
> On Jun 19, 1:49 pm, "gbk *" <[EMAIL PROTECTED]> wrote:
>
> > have you tried $form->error with wrap option?
>
> > from the api docs:
>
> > 'wrap' mixed Whether or not the error message should be wrapped in a
> > div. If a string, will be used as the HTML tag to use.
>
> > On jún. 19, 19:11, Vlad <[EMAIL PROTECTED]> wrote:
>
> > > I can't believe FormHelper gives you so much control over markup
> > > except a little thing called the error message. I have wasted three
> > > hours now trying to figure out how to make the generated error
> > > message's markup from <div class="error-message">Message</div> to <li
> > > class="error">Message</li>. That's all that I need to get my form
> > > exactly like I want it to be.
>
> > > Please, anyone here know how I can pull this off? Does anyone know in
> > > what file is that markup generated so I can go and change it?
>
> > > Thank you so much.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" 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