Pagination problem. - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Pagination problem. (/showthread.php?tid=49505) Pages:
1
2
|
Pagination problem. - El Forum - 02-22-2012 [eluser]peekk[/eluser] Hello, I have a weird problem with pagination, my configuration is: Code: function searcher($keyword=''){ And my problem is, when i'm searching for something, i.e. "computer". My results are displayed, first page URL is: example.com/search/searcher/computer/0. Now, when I click on my page link, i.e. page 2, URL changes to example.com/search/searcher/computer/25, seems good. Results are correct too. My only problem is my pagination links below. It doesn't mean if i'm on page 1 or page 15, it's always the number 1 bolded. Results are correct, URL is correct, but I ALWAYS see this: Quote:1 2 3 > Last ›. What's wrong? Pagination problem. - El Forum - 02-22-2012 [eluser]InsiteFX[/eluser] Your not passing the page offset to it! Code: $config['base_url'] = base_url().'search/searcher/'.$keyword.'/'; Pagination problem. - El Forum - 02-22-2012 [eluser]meigwilym[/eluser] What you need is to pass the uri_segment to the config Code: $config['uri_segment'] = 4; Mei Pagination problem. - El Forum - 02-22-2012 [eluser]Mauricio de Abreu Antunes[/eluser] [quote author="meigwilym" date="1329923253"]What you need is to pass the uri_segment to the config Code: $config['uri_segment'] = 4; Mei[/quote] Code: $segment = 4; Pagination problem. - El Forum - 02-22-2012 [eluser]meigwilym[/eluser] @mauricio I'm not sure what you're trying to tell me here. Can you expand a bit? * Scratch that, looking at the original code I now see what you mean. Thanks. Mei Pagination problem. - El Forum - 02-22-2012 [eluser]Mauricio de Abreu Antunes[/eluser] [quote author="meigwilym" date="1329923969"]@mauricio I'm not sure what you're trying to tell me here. Can you expand a bit? * Scratch that, looking at the original code I now see what you mean. Thanks. Mei[/quote] You are welcome! I coded a method in my MY_Controller to control pagination config. And obviously, a config in application/config/upload.php. Bye! Pagination problem. - El Forum - 02-22-2012 [eluser]peekk[/eluser] Thanks, advice about setting an uri segment in config array worked like a charm : ) Pagination problem. - El Forum - 02-23-2012 [eluser]peekk[/eluser] I have 1 more question, and i think it's not worth to create a new topic for it (it seems not hard). How can i do, that my links will be example.com/search/searcher/<OFFSET>/keyword - I mean I want to change the order of keyword and offset of my URLs, I was trying by routing, but I couldn't do this. My try was about that: Code: function searcher(offset=0,$keyword=''){ I just need to change order in URLs, and make it work. How to do it? Pagination problem. - El Forum - 02-23-2012 [eluser]aquary[/eluser] The "append URI" is not supported by CI's pagination. I guess you have to extend the pagination library and add a new configuration yourself. Pagination problem. - El Forum - 02-23-2012 [eluser]peekk[/eluser] [quote author="aquary" date="1330007875"]The "append URI" is not supported by CI's pagination. I guess you have to extend the pagination library and add a new configuration yourself.[/quote] Allright, thanks ; ) |