Answer the question
In order to leave comments, you need to log in
How to setup CNC GET parameter on YII2?
'urlManager' => [
'enablePrettyUrl' => true,
'showScriptName' => false,
'rules' => [
'?<key>=<value>' => '/<key>/<value>'
],
],
Answer the question
In order to leave comments, you need to log in
'rules' => [
'shop/products/<id_category:\d+>' => 'shop/products'
],
'rules' => [
'shop/products/id_category/<id_category:\d+>' => 'shop/products'
],
If you pass GET parameters in the url, then they need to be represented a little differently in the array index, for example:
'/news/<category_id:[\d]+>/<article_id:[\d]+>' => 'news/show'
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question