Hi All,
I've read about data validation in CakePHP 1.2 version and I change my
model $validate var as below :
------------------------------------------------------------------------
var $validate = array(
'username' => array('rule', array('alphaNumeric')),
'password' => array('rule', array('alphaNumeric'))
);
------------------------------------------------------------------------
and I test the validation with following code in my controller
------------------------------------------------------------------------
$data = array ( 'User' => array ( 'username' =>
'dfsdfjhjhg', 'password' => 'sdffsdfsdf') );
$this->User->create($data);
if ($this->User->validates())
{
echo 'succeed';
}
------------------------------------------------------------------------
But the code returns this warning :
Warning (2): preg_match() [function.preg-match]: Delimiter must not be
alphanumeric or backslash [CORE\cake\libs\model\model.php, line 1674]
What's wrong ?
Regards,
Feris
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" 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
-~----------~----~----~----~------~----~------~--~---