Answer the question
In order to leave comments, you need to log in
How to create validation for symbols?
Good afternoon
How to create a validation rule according to the rule: Name_Firstname?
Answer the question
In order to leave comments, you need to log in
public function rules()
{
return [
[
'user_name',
'match',
'pattern'=>'/^[A-Z][A-Za-z]*_[A-Z][A-Za-z]*$/',
],
];
}
What is this "Name_Firstname" rule?
In any case, most likely we are talking about a regular expression, then here:
www.yiiframework.com/doc-2.0/guide-tutorial-core-v...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question