Before Creating my First CodeIgniter Application.

Before Creating my First CodeIgniter application.

Before making my first application which simply displays a static page, there are some things that I would like to take note.

CodeIgniter have several folders under its application folder. In that folder you will find the controllers folder and the view folder

Note: you might find some tutorials online using different versions of CodeIgniter in which the application folder is under the system folder. In Version 2.1.0, the application folder is outside the system folder.



The controllers folder contains the controllers for the application. From the CodeIgniter tutorial:


A controller is simply a class that helps delegate work. It is the glue of your web application.


The analogy that I can think of to simplify this is:  a controller is like the steering wheel of your car. You don't see the driver turn the steering wheel but you know it when the car itself turns.  In CodeIgniter, the codes that displays the actual pages are in the views folder.


Thus when a user opens a page created using CodeIgniter, this what happens:




When the viewer opens the page Hello World, in regular HTML or PHP page, the viewer will simply type. http://www.mydomain.com/helloworld.html.

In a CodeIgniter page or application , he URL would be:  http://www.mydomain.com/index.php/hello/world

Where hello is the controller which is saved in the controllers folder  which calls the method (or function) named world. 

The view page, which is in the views folder, is called to display the contents / information processed in the controller, in a way I wanted it.

Therefore, in a CodeIgniter application, at least two pages are needed, one controller page and one view page.

This will be the objective of my first page (the undying): Hello World!



Comments