I expanded the CodeIgniter controller by adding MY_Controller.php to the Application / Core folder. It works fine, but now when I add the following code to the page error_404.phpin Application/errors, I get an error.
The problem causing the code:
<?php $ci =& get_instance();?>
<?php $this->ci->load->view('header')?>
Error:
Fatal error: Class 'CI_Controller' not found in path\to\system\core\CodeIgniter.php on line 231
Line 231 system\core\CodeIgniter.php:
function &get_instance()
{
return CI_Controller::get_instance();
}
How can I fix this to load the view into the error_404.php file without changing anything in the system files.
PS. I am using the latest version.
Thank.
source
share