Answer the question
In order to leave comments, you need to log in
How to configure Yii2 routing for search (search) / pagination?
The following rules are included:
'<controller:\w+>/<id:\d+>' => '<controller>/view',
'<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>',
'<controller:\w+>/<action:\w+>' => '<controller>/<action>',
'<controller>' => '<controller>',
http://localhost/?ProductSearch%5Bcategory%5D=&ProductSearch%5Bcategory%5D%5B%5D=1&ProductSearch%5Bcategory%5D%5B%5D=2&ProductSearch%5Bprice_start%5D=&ProductSearch%5Bprice_end%5D=
http://localhost/?page=2&per-page=5
Answer the question
In order to leave comments, you need to log in
Found the answer here:
yiiframework.ru/forum/viewtopic.php?t=30274
semicolon - not allowed. In the search, the number of parameters is not known, so the rule can be made, but then you have to change the logic in a bunch of places, replacing it with crutches. For what? The search result should not be CNC this is normal. But if it itches a lot, it's easier to switch from GET to POST
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question