controllers/UserController.php
public function actionRequestPasswordReset()
    {
        $model = new PasswordResetRequest();
        if ($model->load(Yii::$app->getRequest()->post()) && $model->validate()) {
            if ($model->sendEmail()) {
                Yii::$app->getSession()->setFlash('success', 'Check your email for further instructions.');

                return $this->goHome();
            } else {
                Yii::$app->getSession()->setFlash('error', 'Sorry, we are unable to reset password for email provided.');
            }
        }

        return $this->render('requestPasswordResetToken', [
                'model' => $model,
        ]);
    }
public function actionRequestPasswordReset()
    {
        $model = new PasswordResetRequest();
        if ($model->load(Yii::$app->getRequest()->post()) && $model->validate()) {
            if ($model->sendEmail()) {
                Yii::$app->getSession()->setFlash('success', 'Check your email for further instructions.');

                return $this->goHome();
            } else {
                Yii::$app->getSession()->setFlash('error', 'Sorry, we are unable to reset password for email provided.');
            }
        }

        return $this->render('requestPasswordResetToken', [
                'model' => $model,
        ]);
    }
public function actionRequestPasswordReset ( ) { $ model = new PasswordResetRequest ( ) ; if ( $ model -> load ( Yii :: $ app -> getRequest ( ) -> post ( ) ) && $ model -> validate ( ) ) { if ( $ model -> sendEmail ( ) ) { Yii :: $ app -> getSession ( ) -> setFlash ( 'success' , 'Check your email for further instructions.' ) ; return $ this -> goHome ( ) ; } else { Yii :: $ app -> getSession ( ) -> setFlash ( 'error' , 'Sorry, we are unable to reset password for email provided.' ) ; } } return $ this -> render ( 'requestPasswordResetToken' , [ 'model' => $ model , ] ) ; }
Request reset password
@return string
Request reset password