Re: Using 2.2.0-RC2 dynamic validation API from the Controller

2012-11-28 Thread Lukman Hussein
> > When the model saves ($this->Campaign->save($this-> > request->data)), the validation list does not appear to have the new > validation rule in it. I have traced out the validation set that the > validator is using at save, and it is using only the validation rules that > were initially set

Re: Using 2.2.0-RC2 dynamic validation API from the Controller

2012-06-27 Thread majna
You can add validator form controller, added rules are not appended to Model::validate property. Try to debug : $this->Campaign->validator()->add('advertiser_id', 'notEmpty', array( 'rule' => 'notEmpty', 'required' => true, 'message' => 'Assigning an advertiser is required' )); $t

Re: Using 2.2.0-RC2 dynamic validation API from the Controller

2012-06-27 Thread JP
I got the same problem, but I made it globaly for captcha: // AppModel.php function addCaptchaValidation($result){ $this->validator() ->add('Captcha', 'notEmpty', array( 'rule' => 'notEmpty', 'required' => true, 'message' => 'form

Using 2.2.0-RC2 dynamic validation API from the Controller

2012-06-21 Thread Adam Duro
I am trying to use the CakePHP 2.2.0-RC2 dynamic validation API to create a new validation rule for a Model via a Controller. First of all, is this possible at all? So far when I try and run this in a controller: $this->Campaign->validator()->add('advertiser_id', 'notEmpty', array( 'rule'