static page controller PHP CodeIgniter


show more Creating a static page controller provides you with in-depth training on Developer. Taught by Jon Peck as part of the Up and Running with PHP CodeIgniter show less
please wait ...

Creating a static page controller

In CodeIgniter, and other MVC frameworks for that matter, a controller can be practically thought of as a class that delegates work. Each controller is named so it can be accessed via URL. To determine what controller to use, CodeIgniter uses the following pattern for routing a user's request to the right controller. Index.php, followed by the controller class, then the controller method, and then any optional arguments. Let's take a look at how this default message is being rendered. From Netbeans, navigate to the application route, and open the controllers directory. There are two files in here: index.html, which, when I open, I can see is just a simple place holder denying access.

Close it, then open welcome.php. The first line is a safety mechanism that prevents direct access to the controller. Then, a subclass declaration that extends the codeIgniter controller class. The name of the class is Welcome, with a capital W. This is different than the file name, which is all in lower case. Th...

Creating a static page controller
Video duration: 4m 14s 1h 30m Intermediate

Viewers:

Creating a static page controller provides you with in-depth training on Developer. Taught by Jon Peck as part of the Up and Running with PHP CodeIgniter

Subject:
Developer
Software:
PHP CodeIgniter
Author:
please wait ...