Suppose I have a helper called “foobar” defined like this:
<?php if(!defined("BASEPATH")) exit("No direct script access allowed");
I add this helper to the list of automatically loaded helpers in config/autoload.php, and now in a controller, I want to do this:
$foobar = getFoobar();
class Foobar extends CI_Controller
public function __construct()
public function index()
The problem is that this fails, saying getFoobar() isn’t defined (I assume this is because the loading of helpers and other things occurs when I call parent::__construct() in a controller).
How can I access helper functions outside of controllers?