Answer the question
In order to leave comments, you need to log in
Creating rules in urlManager in Yii2?
Let's say there is such a link,
" http://mysite.com/site/sub?al=villas-and-houses "
I want to see " http://mysite.com/villas-and-houses " when I go to it,
wrote this rule, but there is one but, it works where there is one word in the get parameter or is separated by an underscore, and where there is a hyphen it does not want to work, how can I make it work with a hyphen?
'' => 'site/sub',
Answer the question
In order to leave comments, you need to log in
'urlManager' => [
'class' => 'yii\web\UrlManager',
'enablePrettyUrl' => true,
'showScriptName' => false,
'rules' => [
'<al>' => 'site/sub'
]
],
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question