CodeIgniter Tutorial: How to Create Ajax Pagination using CodeIgniter?

CodeIgniter has many built-in classes and plugins. Pagination class of CodeIgniter is very easy and simple to use. Also Ajax Pagination library is availanle in Codeigniter. Here i will describe how to create simple ajax pagination in Codeigniter using some simple steps.
First of all download Ajax Pagination from Codeigniter site. And put this library in “system/libraries/” folder.
Along with library you need to download prototype.js file and put this file any where on root.
Here we have a table which we use for getting records and apply pagination on its records.

Your controller:

Model :

View: paging.php in application/views/ folder

View: friend_list.php in application/views/ folder

Friend Name Friend Phone Friend Address
echo $row->f_name echo $row->f_phone echo $row->f_address

Main home file: main.php in application/views/ folder
This file contains your html code and all css and js files.
I have just given main container where your data will show. you have to add html and css/js files your self.

echo @$body_content;

5 thoughts on “CodeIgniter Tutorial: How to Create Ajax Pagination using CodeIgniter?”

Comments are closed.