frontend/controllers/UserController.php
/**
     * Resets password.
     * ***It may be needed
     * @param string $token
     * @return mixed
     * @throws BadRequestHttpException
     */
Resets password.
It may be needed
@param string $token
@return mixed
@throws BadRequestHttpException
Resets password . It may be needed @param string $token @return mixed @throws BadRequestHttpException
public function actionResetPassword($token)
    {
        try {
            $model = new ResetPasswordForm($token);
        } catch (InvalidParamException $e) {
            throw new BadRequestHttpException($e->getMessage());
        }
        if ($model->load(Yii::$app->request->post()) && $model->validate() && $model->resetPassword()) {
            Yii::$app->session->setFlash('success', 'New password was saved.');
            return $this->goHome();
        }
        return $this->render('resetPassword', [
            'model' => $model,
        ]);
    }
public function actionResetPassword ( $ token ) { try { $ model = new ResetPasswordForm ( $ token ) ; } catch ( InvalidParamException $ e ) { throw new BadRequestHttpException ( $ e -> getMessage ( ) ) ; } if ( $ model -> load ( Yii :: $ app -> request -> post ( ) ) && $ model -> validate ( ) && $ model -> resetPassword ( ) ) { Yii :: $ app -> session -> setFlash ( 'success' , 'New password was saved.' ) ; return $ this -> goHome ( ) ; } return $ this -> render ( 'resetPassword' , [ 'model' => $ model , ] ) ; }
Resets password.
Resets password .