Possible Duplicate:
Codeigniter extending extended MY_Controller
I have been fiddling with this problem for a while now, and am at the point of frustration. I am extending the controller class with MY_Controller.
Here are the details:
__construct()
does not seem to be called.- The file is located in application/core as it should be
- The file is named MY_Controller.php
- I have
MY_
set up as the prefix for extensions (I have other extensions which work fine)
Here is my code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class MY_Controller extends CI_Controller {
function __construct()
{
parent::__construct();
echo 'TESTING!!!'; // This should print, followed by an ob_start() error
}
}
I should get a page back that says TESTING!!!
followed by an ob_start() error, but instead the page renders normally.
I have tried splitting up the constructor class and just calling a private function within MY_Controller, but that doesn't work. I know the file is being called because if I purposefully create a php error within MY_Controller.php, the page will error out. It seems to me that the __construct()
is just not running.