Create and Download Zip file in CodeIgniter

In PHP, ZipArchive Class is used for creating a zip file.

For adding a whole directory files need to read directory files one by one and add in the ZipArchive Class object.

CodeIgniter already provided a zip library that allows either add files or a directory for Compress.

Need to load the zip library for using it.

In this tutorial, I show how you can create a zip file, download, and save it to the server with CodeIgniter.

Create and Download Zip file in CodeIgniter

Read more

Build 5 Star Rating System with jQuery AJAX in CodeIgniter 3

Nowadays mainly in every e-commerce website, there is a rating option on the product page. User can rate the product based on its quality, usefulness, etc.

This rating is helpful for the other user who wants to purchase the product.

There are many jQuery plugins are available to add a rating bar on the page.

In this tutorial, I am using the Bootstrap star rating plugin to create rating system in the CodeIgniter 3 project.

Build 5 Star Rating System with jQuery AJAX in CodeIgniter 3

Read more

Call Model method from another Model in CodeIgniter

In CodeIgniter, the Model is used for the Database manipulation – fetch, insert, update, and delete records.

If within the project there are multiple Models are available then it may require to perform the action in a Model which is already created in another Model.

In this case, you can either create a separate function to perform the same action or use the already available method in the Model.

It is possible to reuse the method in the Model from another Model.

Models are loaded in the Model as same as loaded in the Controller using $this->load->model().

In this tutorial, I create 3 Models and call 1st and 2nd Model methods from the 3rd Model.

Call Model method from another Model in CodeIgniter

Read more

Sort Pagination records on Header Click in CodeIgniter

Pagination is used to display the large list of records in multiple pages form. This makes easier to access records.

You can make traversing more easier by add sorting on the table.

The table list gets arranged according to the clicked header.

In this tutorial, I show how you can implement pagination sorting on header click in CodeIgniter.

Sort Pagination records on Header Click in CodeIgniter

Read more