php - CakePHP why am I getting this error? -
here error message:
warning (2): preg_match() [http://php.net/function.preg-match]: delimiter must not alphanumeric or backslash [core/cake/libs/model/model.php, line 2611]
this happening when call following code controller:
$this->account->save($this->data)
the model looks this:
class account extends appmodel { var $validate = array( 'first_name' => array( 'rule' => array('minlength', 1), 'required' => true ), 'last_name' => array( 'rule' => array('minlength', 1), 'required' => true ), 'password' => array( 'rule' => array('minlength', 8), 'required' => true ), 'email' => array( 'emailrule1' => array( 'rule' => 'email', 'required' => true, 'message' => 'you must specify valid email address' ), 'emailrule2' => array( 'rule' => 'unique', 'message' => 'that email address in our system' ) ) ); }
i found similar problem explained here
he solved changing required' => true
required' => array(true)
tried every occurange in model did not fix problem.
the problem named rule unique
should isunique
instead.
i have figured out faster better error message.
Comments
Post a Comment