Codeigniter directory structure and role
- Codeigniter Introduction and flow of MVC
- Codeigniter directory structure and role
Hello friends in the second part of this series we will understand about Codeigniter directory structure and role.
In the root folder of codeigniter framework we will see following diretories.
application -> This directory contains functional files and sub directories.
system -> System folder contains Codeigniter main core files of the frameworks like database, helpers, libraries etc.
test -> This directory contains core files test cases.
user_guide_src -> This directory contains user guide and codeigniter manual for ci tutorial and guide line.
Application directory contains lots of files and sub directories as folowing.
———————– All the static files and database cache files being saved in cache folder. Cache files used for improve website load performance.
———————– Config directory contains application configuration files like database, session, routing, encryption. etc
———————– All Controller php files will be saved in this directory. Controller files has business logic of application.
———————– If you want to replace original core functionality or own code you may use core directory.
———————– If you want to create a global function like file upload, clean_url or what ever you want to can create a helper file in this directory . And this function will be available globally in application.
———————– CodeIgniter’s Hooks feature provides a means to tap into and modify the inner workings of the framework without hacking the core files.
————————If you want to create a functionality which called before some action like before_controller_load or before_system_call, then you can user hooks functionality.
More details about codeigniter looks are given here https://www.codeigniter.com/user_guide/general/hooks.html
———————— In the language directory we can create multiple language file support php file like . en,hn. All the content in application will be replace with given variable values.
———————— If you want to create a custom library or want to override existing library then you must crate file in this directory.
———————— If logs are enable then all system and user created information will be logged in this directory.
———————— Model directory contains models php files that contains all database logic and database queries.
———————— If you want to add third parties library like eloqant model or other libraries the you can save these libraries in this folder. Its optional.
———————— All the presentation files and view file being written and saved in this directory.
So finally its a simple brief description of codeigniter directory structure. That is enough for understand Codeigniter directory structure and role. When you will work with codeigniter defiantly you will learn more things.