Beispiel #1
0
 public function actionChangePassword()
 {
     $notify = "";
     $type_notify = "";
     if (Yii::$app->user->isGuest) {
         return $this->goHome();
     }
     $model = new ChangePasswordForm();
     if ($model->load(Yii::$app->request->post())) {
         if ($model->ChangePassword()) {
             $notify = "Change password successfully";
             $type_notify = "success";
         } else {
             $notify = "Change the password to fail";
             $type_notify = "danger";
         }
     }
     return $this->render('change-password', ['model' => $model, 'notify' => $notify, 'type_notify' => $type_notify]);
 }