Codeigniter Directory Structure
If you want to learn a framework you first have to understand the directory structure of a framework, so I've attached a screenshot above.
When you'll download the footprint of the Codeigniter framework from the Codeigniter official website, you will see the directory structure as shown in the above image. Because it has a very small footprint something around 2.6 MB, it is a very fast and stable framework.
If you see the screenshot, you will see 4 folders. And each folder has some subdirectories. Now let me explain these directories.
application:- This is the folder where we mostly write our business logic. It consists of models, views, controllers, config, and other important stuff. Overall, all your code will be placed under the application directory.
user_guide:- This is offline documentation of the CodeIgniter framework. In user_guide, you will see well-explained documentation about classes, libraries, helpers, configuration, etc. So, while learning the Codeigniter framework, I'd suggest you please go through the documentation once.
index.php:- And this the most important file and it is the entry point of the Codeigniter framework.
Now, let's go deeper inside the application folder
In the application folder, you will get the following subdirectories.
- cache: Here we store cached files.
- config: This is the folder where we save our configuration.
- controller: We define all our controllers inside this folder.
- core: Inside this folder, we extend our Codeigniter core classes.
- helpers: Inside this folder, we can define our custom helpers or we can also extend existing helpers.
- hooks: Inside this folder, we define our custom hooks
- language: If our web application is multilingual, then we put our language files inside this folder
- libraries: Inside this folder, we can define our custom libraries or we can also extend existing libraries.
- logs: We keep our log files inside this folder.
- models: Inside this folder, we define all our models.
- third_party: Inside this folder, we place all the third party libraries or packages.
- views: Inside this folder, we define all our views.
Now, let's go deeper inside the system folder
- core: This is the folder where you'll see core classes of Codeigniter framework which runs the Codeigniter framework. It is highly advisable do not change files inside this folder.
- database: This folder contains database drivers and all the database related files.
- fonts: This folder contains all the font-related information.
- helpers: This folder contains built-in helpers that we can use in our project.
- language: This folder contains all the language file which are used by the Codeigniter framework.
- libraries: This folder contains built-in libraries that we can use in our project.
Comments
Post a Comment