我设置了规则“isUnique”并为“on”选项设置了“create”值。
完整代码:
'username' => array(
'notempty' => array(
'rule' => array('notempty'),
'message' => 'Empty field',
'required' => true,
),
'between' => array(
'rule' => array('between',3,25),
'message' => 'Too long value'
),
'unique' => array(
'rule' => 'isUnique',
'on' => 'create',
'message' => 'Already taken',
'required' => true,
)
)
但是当我尝试登录时,我收到错误消息。为什么?
CakePHP 2.2.1