Answer the question
In order to leave comments, you need to log in
URL route for a module in Yii2, how to set it correctly?
The question is how to correctly write routes in Yii2 basic to call the controller and action
so that the url is of the form hostname/site/moduleName/controllerName/actionName ?
trying to do so
'rules' => [
'/' => 'site/index',
'<controller:\w+>/<action:\w+>' => '<controller>/<action>',
// '<module:\w+>/<controller:\w+>/' => '<module>/<controller>/index',
'site/<module:admin>/<controller:\w>/<action:\w+>'=>'site/<module>/<controller>/<action>'
// '<module:admin>/<controller:\w+>' => '<module>/<controller>/index',
],
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