vikash
vikash

Reputation: 475

How to call controller action in hyper link in yii 2.0

I am trying to give url for call controller action in hyperlink but when i give the url to hyper link it give 404 error .

<div class="panel-footer ">

        Forget Password!<?= Html::a('Forget password ', ['user%2Fforgot'])?>  
    </div>

when use this hyper link it not show like this :http://localhost/basic/web/index.php?r=user%2Fforgot. but show the url like this.:http://localhost/basic/web/index.php?r=home%2Fuser%2Fforgot. don't understand how the home show in url.

Upvotes: 0

Views: 792

Answers (2)

Insane Skull
Insane Skull

Reputation: 9358

You don't need to use user%2Fforgot it will be automatically done.

Try this example:

<div class="panel-footer ">
     Forget Password!<?= Html::a('Forget password ', ['/user/forgot'])?>  
                </div>

Upvotes: 1

GAMITG
GAMITG

Reputation: 3818

You should try.

<div class="panel-footer ">
     Forget Password! <?= Html::a('Forget password ', ['/user/forgot'])?>  
</div>

Upvotes: 1

Related Questions