you can vhange it on the fly in controller something like
$this->User->validate = array('yourvalidationarray'); or
$this->User->changeValidation(); in controller and in User model:
function changeValidation()
{
$this->validate = array(); //your validation array
}
--
Lep pozdrav, Tilen Majerle
http://majerle.eu
2011/6/23 Prabha Vathi <[email protected]>
> Hi,
>
> var $validate = array(
> 'password' => array(
> 'notEmpty' => array(
> 'rule' => array('minLength', 5),
> 'required' => true,
> 'allowEmpty' => false,
> 'message' => 'Please enter a password'
> ),
> 'passwordSimilar' => array(
> 'rule' => 'checkPasswords',
> 'message' => 'Different password re entered'
> )
> ),
> 'email' => array(
> 'notEmpty' => array(
> 'rule' => 'email',
> 'required' => true,
> 'allowEmpty' => false,
> 'message' => 'Please enter a valid email'
> ),
> 'unique' => array(
> 'rule' => array('checkUnique', 'email'),
> 'message' => 'Email exist. Use another'
> )
> )
> );
>
> This works good in registration. Now, when user edit, I just want to edit
> email address. Now how to change the validation?
>
> Thanks
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> [email protected] For more options, visit this group
> at http://groups.google.com/group/cake-php
>
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others
with their CakePHP related questions.
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php