When defining class properties you can't use expressions - only data
structures, so you need to populate the $validate array dynamically
inside the model. You can do this in beforeValidate() method in your
model, but be sure to return true.
beforeValidate() {
$this->validate['fieldName'] = array('between' => array(...
etc ...));
return true;
}
Cheers,
Adam
On Dec 22, 4:57 pm, gearvOsh <[email protected]> wrote:
> Is there a way to use dynamic variables within the Model validation,
> an example below.
>
> 'between' => array(
> 'rule' => array('between', $passMin, $passMax),
> 'message' => 'Password must be between '. $passMin .' and '. $passMax
> )
>
> I have an array of config settings that I would like to use here, but
> am lost on a way to do this.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---