Using Sort::links

What should I say,? Congrats or Amen?

But I’m curious what exactly was the problem. Do you say that removing the route property from Psgination resolved the issue of Sort , too?

Why not both? LOL.

So the issue was originally with my .htaccess. I had carried it over from the previous framework we were using and because it was working fine, until I got to the pagination and sort, I never thought to look at it. It was taking the path and appending it as a query string that was going to the index.php file

So this (bad):


RewriteRule ^(.*)$ index.php?$1 [QSA,L]

vs this (good)

RewriteRule ^(.*)$ index.php [QSA,L]

Once that was resolved then the URLs were just being generated with the parameters being passed to the controller action

So a route rule like this


[       // /theme/item/test-1/reviews

        'pattern' => '<module:themes>/<controller:item>/<slug:[\w-]+>/<action>',

        'route' => '<module>/<controller>/<action>',

],

So URLs were being created as this when using including the route property for pagination while having a custom route


/themes/item/theme-2/reviews?slug=theme-2&page=2&per-page=1

In my case the slug that’s passed to the action, was being taken from that route and being added to the URL, because it’s in the $_GET array, as a parameter when being created by the URL manager for pagination. Removing the route property for pagination config solved that.

It’s just weird that it only does it when a route is passed to the pagination object. I couldn’t say why that is, but my original issue was of my own doing…