How to remove the controller name from the URL, when the module is called when it is requested
We have
Need to
How to remove the controller name from the URL, when the module is called when it is requested
We have
Need to
In the component settings, use the following rules:
'urlManager' => [ 'showScriptName' => false, // Disable index.php 'enablePrettyUrl' => true, // Disable r= routes 'rules' => [ '<module:(my-module-name)>/<action:(my-action-name)>' => '<module>/my-controller-name/<action>', ] ], Read more in the documentation section of the rules of routing.
/config/web.php ? I ask something, I just did it, too, but something tells me that somehow it needs to be done inside the module - after all, he and the module. - Roman GrinyovurlManager component can also be attached to the module, but the entry point is the application itself. - Andrey KolomenskyКомпонент urlManager можно и к модулю прикрепить — it is configured in the module class using Yii::configure() as described here ; where in the config.php do so ? But then the rules that we define in this configuration do not work; ... is it because the entry point is the application itself? Sorry, if a stupid question, I just do not fully understand the workflow Yii2? - Roman GrinyovSource: https://ru.stackoverflow.com/questions/467500/
All Articles