22Application Structure
33#####################
44
5- To get the most out of CodeIgniter, you need to understand how the application is structured, by default, and what you
6- can change to meet the needs of your application.
5+ To get the most out of CodeIgniter, you need to understand how the application
6+ is structured, by default, and what you can change to meet the needs of your
7+ application.
78
89.. contents ::
910 :local:
@@ -25,8 +26,8 @@ Each of these directories has a very specific part to play.
2526app
2627===
2728
28- The **app ** directory is where all of your application code lives. This comes with a default directory
29- structure that works well for many applications.
29+ The **app ** directory is where all of your application code lives. This comes
30+ with a default directory structure that works well for many applications.
3031
3132The following folders make up the basic contents:
3233
@@ -44,25 +45,26 @@ The following folders make up the basic contents:
4445 ThirdParty/ ThirdParty libraries that can be used in application
4546 Views/ Views make up the HTML that is displayed to the client
4647
47- Because the **app ** directory is already namespaced, you should feel free to modify the structure
48- of this directory to suit your application's needs.
48+ Because the **app ** directory is already namespaced, you should feel free to
49+ modify the structure of this directory to suit your application's needs.
4950
5051For example, you might decide to start using the Repository
51- pattern and Entities to work with your data. In this case, you could rename the ** Models ** directory to
52- **Repositories **, and add a new **Entities ** directory.
52+ pattern and Entities to work with your data. In this case, you could rename the
53+ **Models ** directory to ** Repositories **, and add a new **Entities ** directory.
5354
54- All files in this directory live under the ``App `` namespace, though you are free to change that in
55- **app/Config/Constants.php **.
55+ All files in this directory live under the ``App `` namespace, though you are free
56+ to change that in **app/Config/Constants.php **.
5657
5758system
5859======
5960
6061.. note :: If you install CodeIgniter with Composer, the **system** is located in
6162 **vendor/codeigniter4/framework/system **.
6263
63- This directory stores the files that make up the framework, itself. While you have a lot of flexibility in how you
64- use the application directory, the files in the system directory should never be modified. Instead, you should
65- extend the classes, or create new classes, to provide the desired functionality.
64+ This directory stores the files that make up the framework, itself. While you
65+ have a lot of flexibility in how you use the application directory, the files in
66+ the system directory should never be modified. Instead, you should extend the
67+ classes, or create new classes, to provide the desired functionality.
6668
6769All files in this directory live under the ``CodeIgniter `` namespace.
6870
@@ -74,28 +76,29 @@ public
7476The **public ** folder holds the browser-accessible portion of your web application,
7577preventing direct access to your source code.
7678It contains the main **.htaccess ** file, **index.php **, and any application
77- assets that you add, like CSS, javascript, or
78- images.
79+ assets that you add, like CSS, javascript, or images.
7980
8081This folder is meant to be the "web root" of your site, and your web server
8182would be configured to point to it.
8283
8384writable
8485========
8586
86- This directory holds any directories that might need to be written to in the course of an application's life.
87- This includes directories for storing cache files, logs, and any uploads a user might send.
87+ This directory holds any directories that might need to be written to in the
88+ course of an application's life. This includes directories for storing cache
89+ files, logs, and any uploads a user might send.
8890
89- You should add any other
90- directories that your application will need to write to here. This allows you to keep your other primary directories
91- non-writable as an added security measure.
91+ You should add any other directories that your application will need to write to
92+ here. This allows you to keep your other primary directories non-writable as an
93+ added security measure.
9294
9395tests
9496=====
9597
96- This directory is set up to hold your test files. The **_support ** directory holds various mock classes and other
97- utilities that you can use while writing your tests. This directory does not need to be transferred to your
98- production servers.
98+ This directory is set up to hold your test files. The **_support ** directory
99+ holds various mock classes and other utilities that you can use while writing
100+ your tests. This directory does not need to be transferred to your production
101+ servers.
99102
100103Modifying Directory Locations
101104*****************************
0 commit comments