Question about pagination on CI3 - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=11) +--- Thread: Question about pagination on CI3 (/showthread.php?tid=61786) |
Question about pagination on CI3 - Mel9pr - 05-16-2015 I am a little lost with CI3 pagination. Let say I have Code: http://example.com/test/page/1/category/item_id using the 3rd segment as the page number (page 1, page 2, page 3, ...) $config['uri_segment'] = 3; I know the documentation says how to reuse the query string like this Code: http://example.com/index.php?c=test&m=page&per_page=20 But that is not working for me. So my question is how do I pass the /category/item_id segments or additional segments on the pagination numbers? all I got so far is Code: 1 = http://example.com/test/page/1 and no /category/item_id segments after the page number Thank You! RE: Question about pagination on CI3 - InsiteFX - 05-17-2015 Segments = Controller / Method / Method / etc; PHP Code: $config['uri_segment'] = 5; RE: Question about pagination on CI3 - Mel9pr - 05-17-2015 (05-17-2015, 03:02 AM)InsiteFX Wrote: Segments = Controller / Method / Method / etc; That will put me in a hard spot due to different variables I must pass on different controllers. I manage to find a walk around using pagination's $config['suffix'] like this Code: $additional_variables = '/category/item_id'; so now I can switch from Code: http://example.com/test/page/1 to Code: http://example.com/test/page/1/category/item_id everything seems to be working right now but not with page number 1. CI pagination ignore everything after the second segment on page 1 like this Code: 1 = http://example.com/test/page/1 that means the user can't go back to see items on the requested category on page 1 RE: Question about pagination on CI3 - Mel9pr - 05-17-2015 (05-17-2015, 08:08 AM)Mel9pr Wrote: everything seems to be working right now but not with page number 1. CI pagination ignore everything after the second segment on page 1 like this Correction: page number 1 can be set using Code: $config['first_url'] = base_url().'test/page/1'.$addittional_variables.$this->config->item('url_suffix'); so now I can have Code: http://example.com/test/page/1/category/item_id |