[eluser]kaejiavo[/eluser]
[quote author="ricardino" date="1287523660"]thanks for the help, ive tried the suggestions mentioned there, but still no luck. so far i have:
a MY_Controller:
Code:
class MY_Controller extends Controller {
function __construct() {
parent::Controller();
}
}
A Site_Controller:
Code:
class Site_Controller extends MY_Controller{
function __construct() {
parent::MY_Controller();
}
and an Admin_Controller:
Code:
class Admin_Controller extends MY_Controller {
function Admin_Controller() {
parent::MY_Controller();
}
but still no luck, it should be noted that if simply extend my usual controllers directly from the Controller class, they work without a hitch, so my code is ok. Also on a slightly different note, what is the purpose of this :
Code:
function __autoload($class)
{
if(strpos($class, 'CI_') !== 0)
{
@include_once( APPPATH . 'libraries/'. $class . EXT );
}
}
Any help would be appreciated.[/quote]
Hi,
you have to use only one file: MY_Controller.php as this will be autoloaded by CI.
Then you put all your three classes in this file, like:
Code:
class MY_Controller extends Controller {
function __construct() {
parent::Controller();
}
}
class Site_Controller extends MY_Controller{
function __construct() {
parent::MY_Controller();
}
class Admin_Controller extends MY_Controller {
function Admin_Controller() {
parent::MY_Controller();
}
Then you can extend your Site_Controller or Admin_Controller as you like.
Marco