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”
Cool, very handy post for nay newcomer to CI.