I want to extend CI_Controller
as a base class for my other classes according do my own need.
I read the user guid. Acted as what it told me.
I created application core:
./application/core/MY_ControllerPermission.php
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class MY_ControllerPermission extends CI_Controller
{
function __construct()
{
parent::__construct();
}
}
And this is my controller:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
if(class_exists('MY_ControllerPermission'))
echo 'clase does exist';
else
echo 'clase does not exist';
class Users extends MY_ControllerPermission
{
....
In my config file:
$config['subclass_prefix'] = 'MY_';
It just show blank page and "clase does not exist"
So where is the problem?
UPDATE
If I add this line:
include_once(APPPATH . 'core/MY_ControllerPermission.php');
before my controller, it would work. Doesn't CodeIgniter load core PHP files automatically?