Answer the question
In order to leave comments, you need to log in
Parsing and generating URLs, creating your own rules?
There are 2 links like this
test.com/site/category?id=1&cat=real-estate
test.com/site/sub?sub=9&al=premium
I want to get links like
test.com/real-estate?id=1&cat=real -estate
test.com/premium?sub=9&al=premium
But as far as I understand, the usual rules cannot be done here, since the controller is the same.
As I understand it, you need to write your own rule for parsing and generating url?
1) In what folder should it be created?
2) How to connect it correctly?
Answer the question
In order to leave comments, you need to log in
the usual rules don't work here.
'urlManager' => [
'enablePrettyUrl' => true,
'showScriptName' => false,
'rules' => [
'/real-estate'=>'site/category',
'/premium'=>'site/sub',
],
],
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question