mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-23 18:18:21 +08:00
Merge pull request #5427 from d0ct0r85/patch-1
[ci skip] Update input-validation.md
This commit is contained in:
@@ -391,7 +391,7 @@ class CountryValidator extends Validator
|
|||||||
public function validateAttribute($model, $attribute)
|
public function validateAttribute($model, $attribute)
|
||||||
{
|
{
|
||||||
if (!in_array($model->$attribute, ['USA', 'Web'])) {
|
if (!in_array($model->$attribute, ['USA', 'Web'])) {
|
||||||
$this->addError($attribute, 'The country must be either "USA" or "Web".');
|
$this->addError($model, $attribute, 'The country must be either "USA" or "Web".');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user