CodeIgniter Forums

Full Version: Reverse Pagging on CI
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]chandrajatnika[/eluser]
Help me please,
I want to show a reverse pagging on my aplication
normal pagging...
at first page showed
1 2 3 > Last
at last page showed
First < 64 63 65

reverse pagging...
at first page showed
First < 64 63 65
at last page showed
1 2 3 > Last

how to create it? is I have to modify Pagination.php on CI system? or create another library?
please send me an example....
Thank you very much

El Forum

[eluser]chandrajatnika[/eluser]
help me please.... Sad

El Forum

[eluser]Flemming[/eluser]
I can't tell you the code you need, but they way to proceed is to copy CI Pagination.php into application/libraries and rename it to 'MY_Pagination.php'

rewrite this file to suit your needs. You don't need to do anything to load it as it will automagically extend the CI Pagination class.

El Forum

[eluser]Dam1an[/eluser]
Just had a quick look at the pagination class, looks like the part you need to change starts at line 200
That's the for loop which renders the links, so if you just flip the condition of the for loop and make it decrement instead of increment, it should (hopefully) give you what you want

At least that should be a starting point, you will probably need to tweak something else somewhere...