I'm programming a application using cakephp but the Method 'MyModel'->validates(array('fieldList) => array('myfield')) is not working. The related validation rule in my model is ignored.
My Controller function is as follows:
function _processaddbasic(){
$this->Caught->set($this->data);
if ($this->Caught-validates(array('fieldList' => array('type_id')))){
return true;
}
return false;
}
My Modelpart is as follows:
public $validate = array(
'type_id'=> array(
'rule' => 'notEmpty',
'required' =>true,
'allowEmpty' => false,
)
)
After executing the code with invalid (empty) data, the related part in my controller returns always true. So, where i'm wrong?