Structure of Codeigniter

The File structure of CodeIgniter is divided into three parts:

  1. Application
  2. System
  3. user_guide
Structure of Codeigniter

Application -:

As the name represents Application, which contains all the main parts of the project like a controller, libraries, view, models, and others. Also, it is that place where you will develop your web application. Here we will discuss some components used in the Application folder.

Structure of Codeigniter2

Cache – This folder contains all the web pages records which you have used in your web application. The cache pages also used to increase web performance and faster to access the web pages in the web application.

Config – The Config folder contains many files that are used to configure the web application. Like autoload.php file which is used to load all libraries, helpers, you can also define your custom files, so you don’t require to call the records or method again and again in your web application. In the database.php file, you can configure your database table with the application. And in routes.php file, you can define the controller’s files and their actions in the application.

Controllers – A controller is used to control the flow of the web application. It means, this can handle all the server-side functionalities. If the controller fails, then all the associated features related to the controller are also failed.

Note: The name of the controller should be in capital letters. Example Main.php file should not be written as main.php.

Core – A CodeIgniter contains some core class that is used as a base class of the application. So, you don’t require any changes in the core files.

Helpers – This helper folder is used to load the functions in the CodeIgniter. Like

load->helper (‘date’); This function will provide the date functionality in the application. Similarly, you can add web files like as html, CSS, javascript, form function.

Hooks- This folder contains some files which are used to tap and update the internal working of the web framework without harming the core files of the application.

Libraries - This folder contains the language-related library files of your application.

Logs – This folder contains some files for checking the status of the CodeIgniter application. Suppose if your CodeIgniter application is facing some error or exception messages and you want to know what they are, then you can check in the logs folder.

Models – Models are used to handle database queries. By use of a model, we can perform CRUD (Create, Read, Update, and Delete) operation in the web application.

Third_party – This folder contains the plugins which are used in the web application for adding the additional functionality in the CodeIgniter application.

View – It contains all the HTML files for showing the output on the browser. A view is used to display a message or information to the user that they want to see.

System

A System folder in CodeIgniter application is used to contain the core codes, libraries, helpers, and other files, which helps to create the coding easy for the developers.

Core – All the core files that are used to create a framework will be stored in this folder. And if you want to enhance the functionality of the web application, then you can create a custom core files in the application folder.

Database – A database folder contains all the database files like drivers, cache, query_builder, and database utilities.

Fonts – This folder contains all the fonts related information and other utilities.

Helpers – It contains some CodeIgniter helpers, which are useful to perform various operations such as cookie, date, email, form, etc.

Language- A CodeIgniter supports multi language web application.

Libraries – A library folder consists of many supported files such as JavaScript, calendar, email, encryption, parser, file upload, etc. and that will be stored in the “application/libraries.”

Structure of Codeigniter3

User_guide

A CodeIgniter provides a basic user_guide to their user/developer for a better understanding and development of the web application. It is an offline user manual guide that shows the step by step learning of the CodeIgniter framework. This manual describes many libraries, function, helpers, and classes which will be used in the CodeIgniter web application.

Besides these three folders (Application, System, and User_Guide), there is another file “index.php.” In this file, you can define the application environment and error level. Also, you can set the system and application folder name. If you are a beginner, then we strongly recommend you, please don’t modify this file.