Thanks a lot! :-D

$this->invalidate worked perfectly.

On 17 ago, 07:54, "Dr. Loboto" <[email protected]> wrote:
> You can try to do $this->invalidate('myField', 'myMessage') in your
> myCustomRule() method and do not use 'message' key in $validate for
> this rule at all.
>
> On Aug 16, 1:11 am, jordicakephp <[email protected]> wrote:
>
>
>
> > Good afternoon everybody,
>
> > I would like thecustomvalidation functions of my models to return
> > differenterrormessages, depending on what the user has sent. That
> > is, to define these messages not in compilation time, but during the
> > execution of the model's logic.
>
> > I've tried to to that in the beforeValidate() method of the model,
> > when defining my validation rules, with the help of $errorMessage (a
> > class variable):
>
> > 'rule'  =>   'myCustomRule',
> > 'message' =>         $this->errorMessage.
>
> > Then, as I say, I manipulate the content of $this->errorMessage inside
> > myCustomRule, depending on what the user writes. But it doesn't
> > work... :-(
>
> > Could somebody please give me a clue about how to define manyerror
> > messages for just onecustomrule? Thanks a lot in advance for your
> > help! :-)- Ocultar texto de la cita -
>
> - Mostrar texto de la cita -
--~--~---------~--~----~------------~-------~--~----~
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