Md. Golam Rabbany

Just work with honesty, Success will come on your door

Monthly Archives: February 2008

How to add your Class at CodeIgniter


Step#1: create your own class
<?
class class_name {

function function_name()
{
echo “I am There”;
}

}
?>

Now save this file on your libraries (system->libraries) and file name is must according to your class name like class_name.php

 

Step#2: create a controller like this…
<?php

class own_controller extends Controller {

function own_controller()

{

parent::Controller();

}

function show_text()

{
$this->load->library(class_name);
echo $this-> class_name -> function_name();
}

}
?>

Now save the controller at your controller folder.

OUT PUT will be “I am There”