public validateAttribute ( |
||
$model | the data model to be validated | |
$attribute | string | the name of the attribute to be validated. |
public function validateAttribute($model, $attribute)
{
$result = $this->validateValue($model->{$attribute});
if (!empty($result)) {
$this->addError($model, $attribute, $result[0], $result[1]);
}
}
/** * @inheritdoc */ public function validateAttribute($model, $attribute) { if ($this->range instanceof \Closure) { $this->range = call_user_func($this->range, $model, $attribute); } parent::validateAttribute($model, $attribute); }