Welcome Guest, Not a member yet? Register   Sign In
pagination don't work as i expect!
#1

[eluser]Lotti[/eluser]
what i want from pagination library is something like this.

page : href
1 : controller/method/1
2 : controller/method/2
3 : controller/method/3
4 : controller/method/4

instead i get this: (don't know if this is a bug or not):

page : href
1 : controller/method
2 : controller/method/1
3 : controller/method/2
4 : controller/method/3

it's ok if codeigniter doesn't want to put a number for first page, but in this case i expect something like this:

page : href
1 : controller/method
2 : controller/method/2
3 : controller/method/3
4 : controller/method/4

what am i missing? any idea?

i can extend the class easily but i want to know if there is a more clean way to do this without "fork" the library. thanks.
#2

[eluser]Zero-10[/eluser]
I believe CI's default pagination uses #results instead of pages. So if it's out of 5 I believe page 3 would be controller/method/15 (or is it 10?) instead of controller/method/3. There are different plugins that you can find that changes the behavior of pagination like there's one in particular on codeigniter's wiki that will count pages instead of results. Interestingly enough last week there were like a dozen pagination threads open, perhaps your answer lies there? It would be quicker (hopefully). Smile
#3

[eluser]Lotti[/eluser]
thank you, i will search inside the wiki
#4

[eluser]adityamenon[/eluser]
Are you outputting only one result per page? Then what you posted happens. But otherwise, CI is going to show (current page number minus one x the number of results per page).
#5

[eluser]Justin Patel[/eluser]
You can edit pagination.php from libraries
#6

[eluser]Lotti[/eluser]
[quote author="adityamenon" date="1310256405"]Are you outputting only one result per page? Then what you posted happens. But otherwise, CI is going to show (current page number minus one x the number of results per page).[/quote]
yes. you're right. that was exactly what i was doing Smile

now i edited the pagination library to match my needs. thank you all.




Theme © iAndrew 2016 - Forum software by © MyBB