A
A
atis //2015-11-01 19:28:59
Yii
atis //, 2015-11-01 19:28:59

How to convert $_GET parameters to CNC in Yii2?

This is nonsense, you need to get urls using the following scheme:

controllerName/actionName/paramName/paramValue
catalog/aqua/page/2
product/name-121/commentaries-page/2

it seems , but it doesn't affect the parameters in any way, well, they don't transform normally now it plows only with product/name-121/?1=2 1 this is the parameter id Above the urlManager - oh, I already scoffed as best I could! I found a similar question here on the Toaster, but it's just not what I need. Doc rummaged through and did not find anything necessary!
enablePrettyUrl = true

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Oleg Aksenov, 2015-11-03
@atis2345

More or less like this

'urlManager' => [
               'enablePrettyUrl' => true, //
               'showScriptName' => false, //
          'rules' => [
                'module/<module:\w+>/<controller:\w+>/<action:\w+>' => '<module>/<controller>/<action>', //
                '<module:\w+>/<controller:\w+>/<action:(\w|-)+>/<id:\d+>' => '<module>/<controller>/<action>',
                '<action>' => 'site/<action>',

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question