I seem to be having a problem with validation. Everything works great
so far but when I have empty fields they still get saved.
Model:
class Girl extends AppModel
{
var $name = 'Girl';
var $validate = array(
'description' => array(
'rule' => array('minLength',1)
)
);
}
Controller:
function admin_add()
{
if(!empty($this->data)) {
if($this->Girl->save($this->data)) {
$this->flash('Girl Has Been
Saved.','/admin/girls');
} else {
$this->flash("Epic Fail","/admin/girls");
}
}
}
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---