@Allessandro, that would not work, you can't initialize model variable
with a function call.

@Emilio, I did post a ticket on this a while ago with a solution (as
you described), it has been introduced and removed after (probably
because it does not cover all needs etc..). I end up writing the
invalidFields method in app_model, taking over the core method.

http://groups.google.com/group/cake-php/browse_thread/thread/fa32c81acc043eef/6a49c6d9fdc6f158?lnk=st&q=#6a49c6d9fdc6f158

hth

On Jul 10, 4:43 pm, Alessandro Daducci <[EMAIL PROTECTED]>
wrote:
> Hi Emilio!
>
>
>
> > I'll ilustrate the problem with an example, I want to make something
> > like this:
>
> > <code>
> >    var $validate = array
> >    (
> >            "status" => array
> >            (
> >                    "rule" => "numeric",
> >                    "rule" => array ("range", -1, 101),
> >                    "message" => "error_task_status",
> >            ),
> >    );
> > </code>
>
> > If you see the message for the error on validation, you see
> > "error_task_status", the idea is that the model calls
> > __("error_task_status") for the message instead of printing
> > "error_task_status" directly.
>
> I don't know if I understood properly, but I usually do this way:
>
> var $validate = array
> (
>         "status" => array
>         (
>                 "rule" => "numeric",
>                 "rule" => array ("range", -1, 101),
>                 "message" => __("error_task_status",true),
>         ),
> );
>
> This way, you can perform translation automatically!
--~--~---------~--~----~------------~-------~--~----~
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