Hello world with Codeigniter
There are simply two processes to view the Hello world page by changing the default Welcome Page.
Process 1: (Simple)
Under the class Welcome there is a function named index (). Under the function index () just type echo 'Hello World!'; So the controller welcome will be (the directory: …/xampp/htdocs/mysite/application/controllers/welcome.php)
class Welcome extends CI_Controller
{
public function index()
{
$this -> load ->view('welcome_message');
}
}
The Output is:
Process 2: (Simple)
Create a Controller name as you wish. For example: hello.php and put the following code in it.
Now type http://localhost/mysite/index.php/hello in the address bar of your favorite browser.
It will display:




Comments
Post a Comment