Answer the question
In order to leave comments, you need to log in
Human friendly url, how to use urlmanager in yii2 correctly?
Hello. Already 100500 topic but I can't get the result.
There is a project on yii2 (trial, I'm learning new tools for myself), in addition to the standard controller, there is CountryController. It can be accessed using the link ----> localhost/yii-basic-app-2.0.1/basic/web/?r=country
By inserting urlmanager into the components area in the config, I try to access the following link - --> localhost/yii-basic-app-2.0.1/basic/web/country but the object was not found.
This is what urlmanager looks like
'urlManager' => [
'enablePrettyUrl' => true,
'rules' => [
'/country'=>'country/index'
],
// ...
],
Answer the question
In order to leave comments, you need to log in
'urlManager' => [
'enablePrettyUrl' => true,
'showScriptName' => false,
'enableStrictParsing' => false,
'rules' => [
'/country'=>'country/index',
],
],
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question