mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-07 16:36:42 +08:00
@ -315,7 +315,7 @@ class MyForm extends Model
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function validateType($attribute, $params)
|
public function validateCountry($attribute, $params)
|
||||||
{
|
{
|
||||||
if (!in_array($this->$attribute, ['USA', 'Web'])) {
|
if (!in_array($this->$attribute, ['USA', 'Web'])) {
|
||||||
$this->addError($attribute, 'The country must be either "USA" or "Web".');
|
$this->addError($attribute, 'The country must be either "USA" or "Web".');
|
||||||
|
|||||||
Reference in New Issue
Block a user