CodeIgniter Tutorial
Home
CodeIgniter Installation
CodeIgniter Configuration
CodeIgniter Features
CodeIgniter URL
CodeIgniter Model
CodeIgniter View
CodeIgniter Controller
CodeIgniter Helper
CodeIgniter Library
CodeIgniter Session
CodeIgniter Flashdata
CodeIgniter Tempdata
CodeIgniter Example
CodeIgniter File Uploading
Form Validation
CodeIgniter Insert Data
CodeIgniter Display Data
CodeIgniter Delete Data
CodeIgniter Update Data
CodeIgniter Send Email
Create CodeIgniter Controller
The CodeIgniter Controller serves as an intermediary between the Model, the View, and any other resources needed to process the HTTP request and generate a web page.
Controller always stored inside Application/controllers folder.Create a Controller
<?php defined('BASEPATH') OR exit('No direct script access allowed'); class Controller_name extends CI_Controller { public function index() { } } ?>
CI_Controller class must be extended when ever you want to create Your own Controller.
Controller name must be Started with Capital letter.
Controller name and file name must be Same.
By default, it is Welcome.php which is the first page to be seen after installing CodeIgniter.Open website with URL :
localhost/How to web code/
You can change your default controller in the application/config/routes.php file.
Here, specify your file name which you want to be loaded by default.
$route['default_controller'] = ' ';