The following is the classic directory tree structure of CodeIgniter:
Note that when we add new plugins and other resources such as bootstrap
, new directories of resources may be added with a name of your choice so that you can refer to them from the specific resource you are developing using the CI BASEPATH
defined parameter as the directory path to the CI_PROJECT_ROOT
directory.
If we add a new directory under the project root, let's say bootstrap
, the path for including resources such as CSS, JavaScript, or images (for example, hello.png
) will be $path = BASEPATH."bootstrap/hello.png"
.
The CI main configuration files have the following major configurations:
$config['base_url'] = '';
The default is an empty string so that CI can calculate the base URL of our project root directory. We shall refer to the base URL in many places in our code, mostly to execute controllers. To get the base URL, we should call:
$base_url = base_url(); // defined in the URL // helper mentioned...