Custom validation rules are not called
唐彡公子
唐彡公子 2018-08-11 15:28:33
0
1
1097

// Validation rules

protected $role = [
'name|Name'=>'require|length:5,20|chsAlphaNum',
'email|Mailbox'= >'require|email|unique:user',
'mobile|mobile phone'=>'require"mobile|unique:user',
'password|password'=>'require|length:6 ,20|alphaNum|confirm'
];

// Validation data
$data = Request::port();
$rule = 'app\common\validate\User' ;
$res = $this->validate($data, $rule); // ====not executed

唐彡公子
唐彡公子

reply all(1)
唐彡公子

solved! Verification rule name variable definition and usage are inconsistent

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template