Answer the question
In order to leave comments, you need to log in
Why does Url::toRoute() with a parameter add a question mark?
We have Yii2 with this routing:
'urlManager' => [
'enablePrettyUrl' => true,
'showScriptName' => false,
'enableStrictParsing' => false,
'rules' => [
…
'p'=>'product/index',
'p/<add:\w+>/<id:(\d|-)+>'=>'product/<add>',
'p/<action:\w+>'=>'product/<action>',
'<action>'=>'site/<action>',
],
],
Url::toRoute(['product/add', 'id'=>$categoryId])
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question