array('username', 'require', '用户名不能为空', 0, 'regex', 3),
array('password', 'require', '密码不能为空', 0, 'regex', 1),
array('captcha', 'require', '验证码不能为空', 0, 'regex', 1),
array('role_id', 'require', '角色不能为空', 0, 'regex', 3),
array('username', '', '已存在的用户名', 0, 'unique', 1),表单只有username,password,captcha三个字段,后面role_id,username是增加数据时验证的。 可是为什么最后一个username唯一验证会生效呢? 它的最后一个参数是明明是1,表示插入数据时才验证啊! 最佳答案