mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-23 18:18:21 +08:00
Update input-validation.md
This commit is contained in:
@@ -391,7 +391,7 @@ class CountryValidator extends Validator
|
||||
public function validateAttribute($model, $attribute)
|
||||
{
|
||||
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