[eluser]ajsie[/eluser]
i have auto-loaded models and libraries, but before i can use them in my models and library classes i have to type like this:
$CI =& get_instance();
$CI->classname->method();
and that's annoying to have to have the first line all the time. so i thought i could have that line in a pre_controller hook.
however, i have to make $CI global for it to work (or that variable will only live in the hook method)
i tried this in the pre_controller hook:
Code:
public function set() {
global $CI;
$CI =& get_instance();
}
but it didnt work. how could i make $CI global through the whole application?
thanks!