/application/core/MY_Controller.php |
Hello, what if I need two (or more) different MY_Controller classes in a core folder? CodeIgniter allows creation only one "extended" version?
I tried PHP Code: class MY_AuthController extends CI_Controller
You just create a single MY_Controller.php file and place your required classes in this file.
I have a MY_Controller.php which has a WEBSITE_Controller class and a ADMIN_Controller class
You should create an autoload function (spl_autoload_register) which can load any base controller.
Here is the autoload method:
PHP Code: /* What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
Using `require` in MY_Controller would be okay.
PHP Code: <?php
Here's an old, but still applicable read: https://philsturgeon.uk/codeigniter/2010...ng-it-DRY/
|
Welcome Guest, Not a member yet? Register Sign In |