In Codeigniter, get_instance() is a globally available function that returns the Controller super-object which contains all the currently loaded classes (it ret
I prefer uses this way, it's simple
class Test
{
//magic method __get, whit this can use $this->load
//instead create a variable ci, then do $this->ci->load, cool :)
public function __get($var)
{
return get_instance()->$var;
}
public function showUrl()
{
$this->load->helper("url");
echo base_url();
}
}