The CI view is enabled with great flexibility to integrate the client-side third-party resources, as well as accessing the CI resources of the CI libraries, helpers, and models.
This section will focus on the CI view syntax and usage guidelines, as a preface to the coming usage code examples.
We can extend the CI library using the third-party libraries from the CI echo system or develop our own libraries.
In a CI project, the view files are located under the application/views/
directory or any subdirectory to this path. For example, we can build under application/views/
subdirectories, for let's say, two different view categories to improve the clarity of the file structure in our project. The following screenshot shows the views location in a CI project directory tree:
For example, to render a template file located at Application/views/templates/
named home.php
, we shall write the following code:
$this->load->view('templates/home'); //The...