CodeIgniter Application Flow Chart

Application Flow Chart

The following graphic illustrates how data flows throughout the system:

CodeIgniter application flow
  1. The index.php serves as the front controller, initializing the base resources needed to run CodeIgniter.
  2. The Router examines the HTTP request to determine what should be done with it.
  3. If a cache file exists, it is sent directly to the browser, bypassing the normal system execution.
  4. Security. Before the application controller is loaded, the HTTP request and any user submitted data is filtered for security.
  5. The Controller loads the model, core libraries, plugins, helpers, and any other resources needed to process the specific request.
  6. The finalized View is rendered then sent to the web browser to be seen. If caching is enabled, the view is cached first so that on subsequent requests it can be served.

let’s develop using autocomplete codeigniter’s core library in eclipse

class CI_Base extends CI_Loader {
// Core CI libraries
var $config ;
var $form_validation ;
var $input ;
var $load ;
var $router;
var $session ;
var $uri;
var $output;
var $db;
var $unit;
function CI_Base()
{
// This allows syntax like $this->load->foo() to work
parent::CI_Loader();
$this->load =& $this;
// This allows resources used within controller constructors to work
global $OBJ;
$OBJ = $this->load; // Do NOT use a reference.
// Core CI libraries
$this->config = new CI_Config();
$this->form_validation = new CI_Form_validation();
$this->input = new CI_Input();
$this->load = new CI_Loader();
$this->router = new CI_Router();
$this->session = new CI_Session();
$this->uri = new CI_URI();
$this->output = new CI_Output();
$this->db = new CI_DB_active_record();
$this->unit = new CI_Unit_test();
}
}

add in Base4.php

class CI_Base extends CI_Loader {

// Core CI libraries

var $config ;

var $form_validation ;

var $input ;

var $load ;

var $router;

var $session ;

var $uri;

var $output;

var $db;

var $unit;

function CI_Base()

{

// This allows syntax like $this->load->foo() to work

parent::CI_Loader();

$this->load =& $this;

// This allows resources used within controller constructors to work

global $OBJ;

$OBJ = $this->load; // Do NOT use a reference.

// Core CI libraries

$this->config = new CI_Config();

$this->form_validation = new CI_Form_validation();

$this->input = new CI_Input();

$this->load = new CI_Loader();

$this->router = new CI_Router();

$this->session = new CI_Session();

$this->uri = new CI_URI();

$this->output = new CI_Output();

$this->db = new CI_DB_active_record();

$this->unit = new CI_Unit_test();

}

}