[eluser]louis w[/eluser]
I was growing tired of having to call get_instance to get the CI super object in all my libs and the occasional view so I set up a helper. Makes calling CI so much easier.
Code:
// Add to a helper and load it from your controller
function CI() {
if (!function_exists('get_instance')) exit('ERROR! : ' . __FILE__ .':'. __FUNCTION__ . ":: Can't get Code Igniter instance. Are you calling this function from within your application?");
$ci =& get_instance();
return $ci;
}
Just call CI() where ever you want to get Code Igniter.
Code:
// Example
<?=CI()->buildBreadcrumb()?>