public function validateAttribute($model, $attribute)
    {
        $value = $model->$attribute;
        $result = $this->validateValue($value);

        if (!empty($result)) {
            $this->addError($model, $attribute, $this->renderMessage($model, $attribute));
        }
    }
public function validateAttribute($model, $attribute)
    {
        $value = $model->$attribute;
        $result = $this->validateValue($value);

        if (!empty($result)) {
            $this->addError($model, $attribute, $this->renderMessage($model, $attribute));
        }
    }
public function validateAttribute ( $ model , $ attribute ) { $ value = $ model -> $ attribute ; $ result = $ this -> validateValue ( $ value ) ; if ( ! empty ( $ result ) ) { $ this -> addError ( $ model , $ attribute , $ this -> renderMessage ( $ model , $ attribute ) ) ; } }
Validates a single attribute.
@param \yii\base\Model $model the data model to be validated
@param string $attribute the name of the attribute to be validated.
@uses [[renderMessage()]]
@uses [[validateValue()]]
Validates a single attribute .