S
S
Sergey2015-04-06 00:26:55
Yii
Sergey, 2015-04-06 00:26:55

Request url encoding in yii2 menu, how to fix?

In the Nav::widget menu, I prescribe the menu section:

['label' => 'My profile', 'url' => ['/profile/professional&id='.$userlog->id]],

A link appears, when I hover over it, I see that the link is correct and will go to:
/index.php?r=profile/professional&id=22
I click on it, goes to:
/index.php?r=profile%2Fprofessional%26id% 3D22
Of course, he writes that the page was not found. I'm editing all those %2Fs and so on. to the desired characters - the page is located.
I save the file with the menu in utf-8 encoding, why is this happening, how to fix it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Makarov, 2015-04-06
@butteff

The url specifies either a URL as a string or an array, where the first part is the route, and the remaining name-value pairs are the parameters. You have neither. Hence the result.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question