addError() public method
Adds an error about the specified attribute to the model object. This is a helper method that performs message selection and internationalization.
public void addError ( $model, $attribute, $message, $params = [] )$model yii\base\Model
The data model being validated $attribute string
The attribute being validated $message string
The error message $params array
Values for the placeholders in the error message