By default, as many of you probably know, codeigniter loads controllers from application/controllers (URI Segment 0)
. Well... I changed it so that it loads them fom application/modules/(URI Segment 0)/controllers/(URI Segment 1 / not set: URI Segment 0)
. Up to here it all works fine, but when I create a controller, I cannot use any of the default function as $this->load
or etc... Example:
/**
* Home Controller Class
*/
class Home extends CI_Controller
{
function __construct()
{
$this->load->database();
}
public function index()
{
echo "Testing...";
}
}
This example would always result in an error:
Severity: Notice
Message: Undefined property: Home::$load
Filename: controllers/home.php
Line Number: 10