Welcome Guest, Not a member yet? Register   Sign In
Pagination on a search page
#1

[eluser]Amenthes[/eluser]
Hi guys, I'm confronted with the following problem. I have a search page that will return large result sets, so a pagination is needed. My question is where should I store the keyword of the search and what should I set "base_url" to in the pagination config array. At a first glance I thought the keyword should be a simple URI segment, but...

1. How do I pass that segment from my search from, which cannot have a POST method as the pagination won't work anymore;
2. What if a user enters a keyword containing a "/"(forward slash)? Basically it will split my segment into two.

I think this is a case where $_GET would do the job but even so, the pagination class won't work because it will append the pagination segment after the GET params. The only solution I can think of is: first, POST the keyword from the form, build the query with that keyword, then generate the base_url of the pagination including an aditional segement - the POST-ed keyword (with any forward slashes replaced by underscores). Then, on any other hit I check if $this->input->post('keyword') returns false, if it does I look for the specific keyword segment and rebuild the query and the pagination. Not very elegant though.

Any suggestions greatly appreciated.


Messages In This Thread
Pagination on a search page - by El Forum - 08-24-2007, 12:21 PM
Pagination on a search page - by El Forum - 08-25-2007, 01:29 PM
Pagination on a search page - by El Forum - 09-10-2007, 12:36 PM
Pagination on a search page - by El Forum - 09-10-2007, 04:46 PM
Pagination on a search page - by El Forum - 04-17-2008, 04:18 PM
Pagination on a search page - by El Forum - 04-17-2008, 05:34 PM
Pagination on a search page - by El Forum - 04-17-2008, 05:37 PM
Pagination on a search page - by El Forum - 04-18-2008, 02:20 AM
Pagination on a search page - by El Forum - 04-18-2008, 10:51 AM
Pagination on a search page - by El Forum - 04-18-2008, 02:09 PM
Pagination on a search page - by El Forum - 04-19-2008, 04:08 PM
Pagination on a search page - by El Forum - 04-19-2008, 08:36 PM
Pagination on a search page - by El Forum - 04-20-2008, 01:48 PM
Pagination on a search page - by El Forum - 06-07-2011, 08:53 PM
Pagination on a search page - by El Forum - 06-09-2011, 01:35 AM
Pagination on a search page - by El Forum - 06-10-2011, 04:47 PM



Theme © iAndrew 2016 - Forum software by © MyBB