4
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
namespace app\validate;
|
||||
|
||||
use taoser\Validate;
|
||||
|
||||
class User extends Validate
|
||||
{
|
||||
protected $rule = [
|
||||
'username' => 'require|max:25',
|
||||
'email' => 'email',
|
||||
'mobile' => 'mobile',
|
||||
'password' => 'require|max:32'
|
||||
];
|
||||
|
||||
// 定义信息
|
||||
protected $message = [
|
||||
'username.require' => '去设置用户名',
|
||||
'username.max' => '用户名最多不能超过25个字符',
|
||||
'mobile' => '手机号格式错误',
|
||||
'email' => '邮箱格式错误',
|
||||
'password.require' => '请设置密码',
|
||||
'password.max' => '密码最多不能超过32个字符',
|
||||
];
|
||||
//定义场景
|
||||
protected $scene = [
|
||||
'register.email' => ['email','password'],
|
||||
'register.username' => ['username','password'],
|
||||
'register.mobile' => ['mobile','password'],
|
||||
];
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user