[Solved] Query String Not Staying In Pagination URL - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: [Solved] Query String Not Staying In Pagination URL (/showthread.php?tid=62060) |
[Solved] Query String Not Staying In Pagination URL - wolfgang1983 - 06-05-2015 On my codeigniter pagination I am trying to get my page size query string in url to stay when I click on my pagination button links. Pagesize is created when I select a from a dropdown menu. When a page size is selected creates url like so http://localhost/project/example/?&pagesize=10 But when I click on my pagination button like lets say my second link it makes url like but does not show pagesize. http://localhost/project/example?per_page=10 When I click on pagination button I would like it to look like http://localhost/project/example?per_page=10&pagesize=10 Question If page size is selected how can I make it show when I click on a pagination link after perpage Any Suggestion PHP Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); Routes PHP Code: $route['example'] = "example/index"; RE: Query String Not Staying In Pagination URL - mwhitney - 06-05-2015 Ever since I stopped using them, query strings make my head hurt, but this setting in the pagination config might help fix your problem: Code: $config['reuse_query_string'] = true; RE: Query String Not Staying In Pagination URL - wolfgang1983 - 06-05-2015 (06-05-2015, 08:11 AM)mwhitney Wrote: Ever since I stopped using them, query strings make my head hurt, but this setting in the pagination config might help fix your problem: Thanks will give it ago in morning will inform you. RE: Query String Not Staying In Pagination URL - wolfgang1983 - 06-05-2015 (06-05-2015, 08:11 AM)mwhitney Wrote: Ever since I stopped using them, query strings make my head hurt, but this setting in the pagination config might help fix your problem: Hi, I got it to work. Any changes you would recommend The model function on controller just in there temporary PHP Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); RE: Query String Not Staying In Pagination URL - Blair2004 - 06-07-2015 Hi, This kind of custom routing did'nt worked for me in my CMS, i used "_remap" instead. RE: Query String Not Staying In Pagination URL - InsiteFX - 06-07-2015 PHP Code: $route['example'] = "example/index"; RE: [Solved] Query String Not Staying In Pagination URL - mwhitney - 06-08-2015 As stated in the docs, (:any) becomes [^/]+, so it only matches a segment, so those other routes are needed if you wish to pass multiple arguments to the index method. However, I'm not sure whether this matters when you're using query strings instead of passing arguments to the controller method. |