Chris Gmyr
Developer, entrepreneur, drummer, biker, dog owner, husband, and proud dad. Loves Laravel and coffee

CodeIgniter Pagination Library


Over the last few years I’ve been using my own version of pagination for CodeIgniter. The default one is pretty weak for my purposes, so I created one for all of my projects that has been very handy. There has been a number of posts on the CodeIgniter forums and their UserVoice account about updating their included pagination library, so I decided to share mine.


  1. Drop everything into your application folder (assets folder is just for demo purposes)
  2. Use: $config[‘uri_protocol’] = ‘PATH_INFO';
  3. Go to the test controller and start working with it. You will have to make your own SQL queries/models.


  • Handles a directory structure or by using the $_GET array. (Ex: or
  • Directory structure can add a trailing slash or not, which is good for SEO (Ex: or
  • Page 1 links will not show a pagination number. Search engines will look at and as duplicate content, so the pagination is dropped.
  • Handles regular links or AJAX update links
  • Automatically builds sorting links
  • Handles different HTML tags (li, div, etc) for pagination links and additional HTML/CSS options.
  • Handles additional search/sorting parameters and will add to the $_GET array
  • Page stats output (Ex: Displaying 1 to 25 (of 115 users))

Please visit the GitHub repo to learn more.

Feel free to leave any feedback or feature requests. Thanks for checking out my library.