CakePHP 的验证问题
我正在练习 CakePHP
用户注册验证,但我从核心收到一些错误:
Warning (2): preg_match() [function.preg-match]: Delimiter must not be alphanumeric or backslash [CORE/cake/libs/model/model.php, line 2611]
这是验证数组:
var $validate = array (
'username' => array (
'ruleUser1'=> array (
'rule' => 'alphaNumberic',
'message' => 'The username must be alphanumeric only'
),
'ruleUser2' => array (
'rule' => 'notEmpty',
'message' => 'Username can\'t be empty'
),
'ruleUser3' => array (
'rule' => 'isUnique',
'message' => 'This username has already been taken.'
)
),
'password' => array (
'rulePass1'=> array (
'rule' => array ('minLength', 8),
'message' => 'Password must be 8 character length'
),
'rulePass2' => array (
'rule' => 'notEmpty',
'message' => 'Password can\'t be empty'
)
)
);
我哪里错了?
I'm making practice with CakePHP
user registration validation but I get some error from the core:
Warning (2): preg_match() [function.preg-match]: Delimiter must not be alphanumeric or backslash [CORE/cake/libs/model/model.php, line 2611]
This is the validation array:
var $validate = array (
'username' => array (
'ruleUser1'=> array (
'rule' => 'alphaNumberic',
'message' => 'The username must be alphanumeric only'
),
'ruleUser2' => array (
'rule' => 'notEmpty',
'message' => 'Username can\'t be empty'
),
'ruleUser3' => array (
'rule' => 'isUnique',
'message' => 'This username has already been taken.'
)
),
'password' => array (
'rulePass1'=> array (
'rule' => array ('minLength', 8),
'message' => 'Password must be 8 character length'
),
'rulePass2' => array (
'rule' => 'notEmpty',
'message' => 'Password can\'t be empty'
)
)
);
Where I'm wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
alphaNumberic 应为alphaNumeric。我认为这就是问题的根源?
alphaNumberic should be alphaNumeric. I think that is the source of the problem?