Sorry, You're right! I confused my code with the one that was in your old post you cited about __contruct(...). I used that trick, it was great!
But I don't understand: you told that in Changeset 5815 that problem was fixed, but I still have it in my 1.2 RC2 version. What's wrong? Sorry for my stupid questions, but I'm a newbie... 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 -~----------~----~----~----~------~----~------~--~---
