Codeigniter Framework Directory Structure

In my previous post we have successfully installed codeigniter in xampp . In this tutorial I am going to describe you codeigniter framework directory structure.

codeigniter flowchart

Codeigniter Framework Directory Structure

codeigniter directory structure

As above image shows one root directory as demo (demo is the name of my codeigniter directory). Under demo there are 3 more folders and some files.

Application Directory

codeigniter application folder

As name suggests the application folder will have all the code of application that we are going to develop. Application folder includes different folders which are:

  • Cache: This folder holds all the cached pages of your application.
  • Config: This folder contain some of the key PHP files of your application like autoload.php, config.php, database.php, routes etc.
  • Controllers : This folder contain all the controllers of your application.
  • Core : By default this folder just have index.html file. But you can write your own base class or extend the core class in this folder.
  • Helpers : This folder contain all the helper function which you want to include in your application.
  • Hooks : By using hook you can modify codeigniter framework inner working files without changing the core files of your codeigniter application.
  • Language : This directory holds language files.
  • Libraries : It may contain third party libraries or user defined libraries for application.
  • Logs : This folder contain log file files.
  • Models : This folder have database access files.
  • Third_party : This folder may have any third party plugin which will be used in application.
  • Views : This folder contain all html pages.

System Directory

codeigniter system folder

System is a main folder where all the codes, helpers, libraries are stored. In this directory there are many other directories which are:

  • Core: This is the main folder containing the entire core classes. Please do not try to change any file in this folder. If you want to extend any core functionality then you can use hooks (application/hooks).
  • Database: This folder has database files like cache, driver, query builder etc.
  • Fonts: This folder have fonts related files.
  • Helpers: The helper folder contains general codeigniter helpers like url helper, array helper, date helper, cookie helper etc.
  • Libraries: This folder contain codeigniter libraries. You can create your own library in application/libraries folder or you can extend or replace standard library.
  • Language: This folder contain language files.

User_Guide

This folder actually a offline version of the user guide website. With the help of user guide you can easily understand Codeigniter framework directory structure, basics and functions, classes and the helpers.

There is one more file index.php. In index.php you can setup the application environment, error level and you can change the path of system, application and view folder. If you are new to codeigniter, do not try to change index.php code.

 

Leave a Reply

Your email address will not be published. Required fields are marked *