Wednesday, December 23, 2009

Validation problem wtih "required" flag set

Hi all,

I have been reading posts on the confusion over "required" flag and I
think I understand it pretty well.

However I am having problem trying to make it work.

For example, here is my call:

$this->User->validate(array('User'=>array('username'=>'test')));

And for the model, I have just one rule, which is "notEmpty" with
"required" set to "true".

Odd thing is that if I use a html FORM to post ($this->User->validate
($_POST['data']), then it works, but not when I invoke it directly.

I am wondering if this has anything to do with the way I structure the
data array?

Any ideas would be appreciated, many thanks in advance.

Philip

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

No comments: