public function actionPasswordReset($token) { try { $model = new PasswordResetForm($token); } catch (InvalidParamException $e) { throw new BadRequestHttpException($e->getMessage()); } if ($model->load(Yii::$app->request->post()) && $model->validate() && $model->resetPassword()) { Yii::$app->getSession()->setFlash('success', 'Спасибо! Пароль успешно изменён.'); return $this->goHome(); } return $this->render('passwordReset', ['model' => $model]); }
public function actionPasswordReset($token) { try { $model = new PasswordResetForm($token); } catch (InvalidParamException $e) { throw new BadRequestHttpException($e->getMessage()); } if ($model->load(Yii::$app->request->post()) && $model->validate() && $model->resetPassword()) { Yii::$app->getSession()->setFlash('success', Yii::t('app', 'FLASH_PASSWORD_RESET_SUCCESS')); return $this->goHome(); } return $this->render('passwordReset', ['model' => $model]); }