O'Reilly logo

Programming with CodeIgniter MVC by Yehuda Zadik, Eli Orr

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Example 1 – hello world

Initially, we will start with a simple example that displays Hello World on the rendered web page. This is an example that doesn't use a database.

The URI will be http://ourdomain.com/index.php/hello.

We can eliminate the index.php file from the path to enable a shorter URI; that is, http://ourdomain.com/index.php/hello.

In order to enable these shorter URIs, we will make configuration changes as described in Chapter 2, Configurations and Naming Conventions, regarding the config.php index_page setting in config.php.

We will build the following two scripts:

  • Controller class: application/controllers/hello.php
  • View script: application/views/helloview.php

In this example, we use the default configuration. For more information about ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required