我想将语言设置为这样的属性:
public function rules() {
return [
['name', 'language' => 'ru', 'message' => 'Just enter the Russian.]
]
}
答案 0 :(得分:2)
试试这个:
public function rules() {
return [
['name', 'match', 'pattern' => '/[а-ѩA-Ѩ]+$/u', 'message' =>Yii::t('app', 'Just enter Russian') ]
]
}