Sorry, you're right! I confused my code while I rewrite it to adapt to
Emilio's case. I just used the trick you cited in yout post (about
__contruct(...) method). It was a very nice solution!

But I still understand one point: you told that in Changeset 5818 that
problem was fixed. But I still have the same problem in RC2 version.
What is wrong?

Sorry my my stupid questions, but I'm a newbie with cakephp...

Alessandro

On 10 Lug, 19:28, francky06l <[EMAIL PROTECTED]> wrote:
> @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/fa32c81a...
>
> 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