/** * @inheritdoc */ public function actionPassword() { $model = new PasswordForm(); $model->setUser(Yii::$app->user->identity); if ($model->load(Yii::$app->request->post()) && $model->save()) { Yii::$app->session->setFlash('success', Yii::t('frontend', 'Your password has been successfully changed.')); return $this->refresh(); } else { return $this->render('password', ['model' => $model]); } }