• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How do you make pagination with search, sort by, order by and limit work?

#1
[eluser]Warz[/eluser]
Hi,

I'm basically just looking for some tips on how to deal with pagination, the best way to do it...

Right now I got this URL:
http://localhost/memberbase/index.php/admin/users/index

This page is supposed to display a list of all users. I need the following:
- Search for username ($_GET search)
- Sort by ID, Username, Email, Country, etc. Both ASC and DESC
- Option to change amount of users displayed per page

This works fine:
http://localhost/memberbase/index.php/admin/users/index/2

I also added support for sort by and order by, which looks like this:
http://localhost/memberbase/index.php/admin/users/index/2/sortby/username/orderby/asc
http://localhost/memberbase/index.php/admin/users/index/2/sortby/username/orderby/desc
etc..
Now, is it so, that I really need to do this:
http://localhost/memberbase/index.php/admin/users/index/2/sortby/username/orderby/asc/perpage/10/search/john

to search for user john?

Is it possible to just go
http://localhost/memberbase/index.php/admin/users/index/search/john
and then later do the sort by, order by and limit?

I know this is possible with $_GET however when turning that on I get

Quote:An Error Was Encountered

The URI you submitted has disallowed characters.

All this just seems rather confusing and not very user friendly? Then maybe there is something I didn't know? What is best practise? How do YOU deal with pagination?

Thanks! Smile


Messages In This Thread
How do you make pagination with search, sort by, order by and limit work? - by El Forum - 05-18-2010, 11:04 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.