5.1验证不支持数组定义message了吗?

浏览:289 发布日期:2018/05/10 分类:ThinkPHP5专区
protected $rule = [
['mobile', ['regex' => '/^1[345789]{1}\d{9}$/', 'require'], ['手机号码格式错误', '请输入用户名']],
['username', ['regex' => '/^1[345789]{1}\d{9}$/', 'require'], ['手机号码格式错误', '请输入用户名']],
['code', ['require', 'length:4'], ['请输入验证码', '请输入四位验证码']],
['password', ['require', 'length' => '6,20'], ['请输入密码', '密码长度在6位到20位之间']]
];

TP5中这个写法可以,TP5.1就提示格式错误
最佳答案
评论( 相关
后面还有条评论,点击查看>>