CodeIgniter Forums

Full Version: Pagination Question
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]ede196620[/eluser]
Hi to everyone whom reads this post i was jest wondering about the pagination in codeigniter is it possible to play around with it so instead of numbers it would display something else ?

El Forum

[eluser]TheFuzzy0ne[/eluser]
Yes, you can extend it, or implement your own version, as outlined [url="http://ellislab.com/codeigniter/user-guide/general/creating_libraries.html"]here[/url]

El Forum

[eluser]ede196620[/eluser]
Is it OK to edit the main pagination library or is it a no no ?

El Forum

[eluser]davidMC1982[/eluser]
If you want to alter any of the main libraries you do this by extending them.

Create a file in your application/libraries folder called MY_Pagination.php and create a class MY_Pagination that extends CI_Pagination.

Examine the Pagination.php file in system/libraries. Your MY_Pagination class will inherit all the methods and properties found here. Any method/properties you define in your MY_Pagination class will override those in the CI_Pagination class.