Search code examples
authenticationpasswordsyii2forgot-password

How to add Forgotten Password text in Login with redirect to other page in Yii2


I need some help how to put the "Forgotten Password" to Login page to redirect to the page I want to go to after its clicked


Solution

  • Try this:

    <?= Html::a(Yii::t('app', 'Forgotten Password?'), 
               ['site/change-password'], 
               ['class' => 'text-center']) 
    ?>
    

    In site Controller :

    public function actionChangePassword()
    {
       return $this->render('ChangePassword');
    }