我想通过特殊字符验证我的姓名文本框
我尝试:-
public function rules()
{
[
'full_name', 'match',
'pattern' => '/^[a-zA-Z\s]+$/',
'full_name' => 'full_name can only contain word characters'
]
}
答案 0 :(得分:2)
尝试一下:
public function rules()
{
return [
'full_name', 'match',
'pattern' => '/^[a-zA-Z\s]+$/',
'message' => 'full_name can only contain word characters'
];
}