/** * @return string|\yii\web\Response */ public function actionChangePassword() { $model = new ChangePasswordForm(); if ($model->load(\Yii::$app->request->post()) && $model->changePassword()) { return $this->redirect(['details']); } return $this->render('change_password', ['model' => $model]); }
public function actionChangePassword() { $user = $this->findModel(); $model = new ChangePasswordForm($user); if ($model->load(Yii::$app->request->post()) && $model->changePassword()) { return $this->redirect(['index']); } else { return $this->render('changePassword', ['model' => $model]); } }