account = Account::readOne($this->id_account); if ( !isset($this->account)){ $this->addError($attribute, Yii::t('frontend/collection', 'Invalid transfer!')); } } public function attributeLabels(){ return [ 'id_account' => Yii::t('frontend/collection', 'Account'), ]; } }