Crud application with codeigniter: Pagination

In the previous tutorial Crud application with codeigniter, we have learn that how to create application with codeigniter. In this tutorial we will learn that how we can perform pagination in this crud application. In this tutorial, we will use in-build codeigniter’s pagination functionality. We will do this step step by step.

  • Openapplication/controllers/Users.php. Change the index function with following code

  • Openapplication/models/Users.php. Change the get_data() function with following code

 

  • Open application/views/user/index.php. Change the whole file with following code.

  • Add following function in your application/models/User.php

  • When you done this change then you will see the following screen with pagination.

pagination

I hope this code will help you to create pagination with codeigniter. If you face any kind of issue then you can add comment at below.