another pagination problem |
[eluser]gwood[/eluser]
I am implementing pagination a record set off a custom db query. For this I am passing a value by using URI segment to the query based on which the records are returned. Now, the first page of the result appears correctly. But then when I click pg2, it shows error as it now longer takes the correct URI segment as argument. That segment now actually turns to the page number and it takes it as an argument and so no record are returned. Well, if I messing it up for you, here's it in simple term... Code: http://localhost/cit/index.php/books/tags/fiction/ I use this URI (books controller, tags function, and fiction is the param) to find books in db table that are tagged as fiction. Now if I use Code: http://localhost/cit/index.php/books/tags/ Code: http://localhost/cit/index.php/books/tags/10 How do I work around this??? Also, is there any way I can make the pagination link appear as say, Code: http://localhost/cit/index.php/books/tags/fiction/10 Thank you!
[eluser]theprodigy[/eluser]
Quote:I use this URI (books controller, tags function, and fiction is the param) It may not be the best way to handle it, but for your current setup, you could always try: Code: class Books extends Controller{ and then run the rest of your code as normal. This is assuming you don't have a book type that is numeric.
[eluser]pickupman[/eluser]
You can double check the pagination docs, but you need to change your uri segment. It defaults to 3, and you need the fourth. Code: $type = $this->uri->segment(3,'fiction'); There are several posts about this problem, you may want to try and search the forums. |
Welcome Guest, Not a member yet? Register Sign In |