E::PASSWORD_REQUIRED], [['password'], 'validatePassword'], ]; } public function validatePassword() { if (!$this->getAccount()->validatePassword($this->password)) { $this->addError('password', E::PASSWORD_INVALID); } } /** * @return \common\models\Account */ protected function getAccount() { return Yii::$app->user->identity; } }