/** * Displays page where user can update account settings password. * @return string|\yii\web\Response */ public function actionSecurity() { $model = new PasswordForm(); $request = YII::$app->request; if ($request->isPost && $model->load(Yii::$app->request->post()) && $model->changePassword()) { Yii::$app->user->logout(); return $this->goHome(); } else { return $this->render('password', ['model' => $model]); } }