I am trying to create my own library so i can handle custom areas in my application. i have a small library located at application/libraries which i called randomizer. it looks like this:
Class Randomizer {
public function __construct()
{
parent::_construct();
$CI =& get_instance();
$CI->load->library('session');
$CI->load->database();
}
function test_function($name)
{
return 'Hi dear' . $name . 'welcome back!';
}
}
In my Controller i tried to test out the simple test_function:
public function index()
{
echo($this->Randomizer->test_function('John'));
exit;
}
And I am getting the following error
Call to a member function test_function() on a non-object