codeigniter tutorial

CodeIgniter Your First  Application

Your First application is a simplest application that will display some text on the screen. Its a simple  application for beginners to understand basic syntax and working of codeigniter MVC framework.

Before starting with this tutorial I assume that you already have a CodeIgniter application installed and configured (removed index.php from url), if u r not removed please refer Codeigniter Configuration 



Lets start be making a basic controller class file. Create a new file in the ‘controllers’ directory and name it ‘hello.php’.


write this following code inside hello.php

defined('BASEPATH') OR exit('No direct script access allowed');  
class Hello extends CI_Controller {  
    public function index()  


Now, create a new file in the ‘views’ directory and name it ‘hello_world.php’.


Put the following code snippet in ‘hello_world.php’.

<!DOCTYPE html>  
        <title>Hello World</title>  
     <p>Hello World!</p>  


Now open the following URL in the browser to see the output