Is there any way to keep my GET parameters when paginating.
My problem is that I have a few different urls i.e
How in my pagination class am I supposed to create a link to the page with a different page number on it but yet still keep the other parts of the url?
In short, you just parse the URL and then you add the parameter at the end or replace it if it already exists.
This example code requires the PHP HTTP module for
http_build_str. The later can be replaced with
http_build_queryand for the first one a PHP userspace implementation exists in case you don't have the module installed.
Another alternative is to use the
Net_URL2package which offers an interface to diverse URL operations:
It's more flexible and expressive.