CodeIgniter's Pagination class is very easy to use, and it is 100% customizable, either dynamically or via stored preferences.
CI pagination is more easy and understandable pagination code structure. This use basic concept of paginations and can customize as user needs.
We can add bootstrap framework pagination style to customize the pagination link.
Before start Codeigniter pagination you need to include $this->load->library('pagination');
in your controller or in autoload.php
file $autoload['libraries'] = array('pagination');
.
Important Notes
- base_url This is the full URL to the controller class/function containing your pagination. In the example above, it is pointing to a controller called “Test” and a function called “page”. Keep in mind that you can re-route your URI if you need a different structure.
- total_rows This number represents the total rows in the result set you are creating pagination for. Typically this number will be the total rows that your database query returned.
- per_page The number of items you intend to show per page. In the above example, you would be showing 20 items per page.
You can Go through Complete Codeigniter Pagination provided by codeigniter.com