Good day! There is a project on Yii2, in the CalendarController controller I display the ListView through the action index in view. Everything works great, but when switching pagination, to the next part of the ListView output, I get a link like this:

http://site.local/calendar/index?filter=vistavky&page=2 

I need

 http://kultpohod.local/calendar?filter=vistavky&page=2 

Those. index remove from line. It is written in the Rules now like this

 '/calendar/<action:\w+>' => 'calendar/index', 

Tell me, please, how to solve this problem. Thank you in advance!

  • filter[0] ada! - tCode
  • incorrectly copied filter = vistavky, although it doesn't change the essence - Rumato
  • You have not fully described the task. Therefore, it is impossible to clearly understand what you want. your current rule in rules doesn't make any sense at all. This is a repetition of the default mechanism for parsing a URL. You can disable the index via 'showScriptName' => false, well, or if the rule is '/ calendar' => 'calendar / index', it is not clear what is passed to the index action. or is there filter through get ()? and why '/ calendar'? What are you using the module? if not - why there / / WebCoder
  • You can disable the index through 'showScriptName' => false - cancel) I did not think about that index) - WebCoder
  • calendar - I use a controller named CalendarController - Rumato

1 answer 1

The problem was solved simply, it was necessary to write in the rules

 '/calendar' => 'calendar/index', 

but not

 '/calendar/<action:\w+>' => 'calendar/index', 

Now everything works and opens as it should, thanks for all the help!