On 29 Jun 2009, at 14:59, 0plus1 wrote:
> I understand that:
>
> if ($this->Post->save($this->data)) {}
>
> but the validation section in the documentation states this command:
>
> if ($this-Post->validates()) {}
this is not required if you are saving see [1]
>
> What of the two is right, can you tell me what I'm doing wrong?
use the if ($this->Post->save($this->data)) {}
and set validate array at the top of the model you wish to validate.
details [2]
hth
mikek
[1] http://book.cakephp.org/view/443/validate
[2] http://book.cakephp.org/view/125/Data-Validation
--
Mike Karthäuser
Managing Director - Brightstorm Ltd
Email: [email protected]
Web: http://www.brightstorm.co.uk
Tel: 07939 252144 (mobile)
Fax: 0870 1320560
Address: 1 Brewery Court, North Street, Bristol, BS3 1JS
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---