I want to change codeigniter pagination query string. Currently this is working like below example
http://example.com/1
I want to change this with my example like
http://example.com?page=1
Anyone can let me know how I can do this without changes in existing library? or Should I have to create my own pagination for this system?
Thanks
You have to set config for pagination
$config['page_query_string'] to TRUE
you also can configure your querystring
$config['query_string_segment'] = 'your_string';
Actually with CodeIgniter 3.0.0 there is a better solution now;
You should enable the reusage of the query string buy enabling this configuration:
$config['reuse_query_string'] = true;
only after that you should initialize the pagination:
$this->pagination->initialize($config);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With