[eluser]RJ[/eluser]
I was looking at the pyro cms source and noticed a method called "ci()" in the MY_Controller file.
Code:
function ci()
{
return get_instance();
}
The method appears to be used in the settings.php file and a helper file. I am using Phil's config file addition for auto-loading to hopefully achieve more "dry" coding.
Code:
function __autoload($class)
{
if(strpos($class, 'CI_') !== 0)
{
@include_once( APPPATH . 'libraries/'. $class . EXT );
}
}
How can this method be used as
Code:
ci()->ion_auth->get_user($user)
as apposed to
Code:
$CI =& get_instance();
$CI->ion_auth->get_user($user);
I don't follow how codeigniter allows or recognizes the ci() method in auto-loaded MY_controller permitting its use in this fashion.
I am asking here because this more of a general framework/coding question then a pyro question. (Note: I am not using Pyro, I am gaining knowledge from reading their code. thanks Phil!)