Codeigniter Hello World

Let’s make a new Controller in our project that will display our Hello World string when this controller url is requested by browser.

Example (application/controllers/Hello.php)

<?php
class Hello extends CI_Controller {
	public function index()
	{
		echo "Hello World!";
	}
}

Output

Untitled
Here index() method is loaded by default when Hello controller url is called.

Directory Structure

Untitled

Share

You may also like...