extending-classes

CodeIgniter 2: How to extend CI_Controller multiple times?

元气小坏坏 提交于 2019-11-28 06:19:27
I have successfully extended the CI_Controller class by creating a MY_Controller.php which I have placed in the application/core directory. core/My_Controller.php looks something like this: class MY_Controller extends CI_Controller { function __construct() { parent::__construct(); } } Then when I create normal controllers they look something like this: class Home extends MY_Controller { function __construct() { parent::__construct(); } function index() { $this->load->view('home'); } } I'm creating a admin back end and I want to have a different base class for controllers to extend instead of

CodeIgniter 2: How to extend CI_Controller multiple times?

被刻印的时光 ゝ 提交于 2019-11-27 01:16:43
问题 I have successfully extended the CI_Controller class by creating a MY_Controller.php which I have placed in the application/core directory. core/My_Controller.php looks something like this: class MY_Controller extends CI_Controller { function __construct() { parent::__construct(); } } Then when I create normal controllers they look something like this: class Home extends MY_Controller { function __construct() { parent::__construct(); } function index() { $this->load->view('home'); } } I'm