message === null) { $this->message = Yii::t('yii', '{attribute} is invalid.'); } } /** * @inheritdoc */ public function validateAttribute($model, $attribute) { $value = $model->$attribute; if (!is_array($value)) { $this->addError($model, $attribute, $this->message); return; } } /** * @inheritdoc */ protected function validateValue($value) { if (!is_array($value)) { return [Yii::t('yii', '{attribute} is invalid.'), []]; } return null; } }