F
F
Flaker2014-06-21 23:36:37
Yii
Flaker, 2014-06-21 23:36:37

(Yii2) How to display link with parameters in yii\bootstrap\Nav widget?

I am using the yii\bootstrap\Nav widget to display the menu.
I'm trying to specify a link to a user profile in one of the Menu Items:

'url' => ['/user/index&id=' . Yii::$app->user->identity->id],

The page is displayed as /index.php?r=user%2Findex%26id%3D and an error pops up during the transition:
Unable to resolve the request: user/index&id=1
If I change href to /index.php?r=user% through Firebug 2Findex&id=1 , then everything works fine.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Zelenin, 2014-06-22
@Flaker

https://github.com/yiisoft/yii2/blob/master/docs/g...
read how to work with urls

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question