Can we extend our own core classes |
[eluser]Aken[/eluser]
If you add the Frontend_Controller class to the MY_Controller.php file, does it work? CI doesn't know to include that file, since there is no auto-load. It's only set up to load MY_Controller. You can put all of your base controllers in that one file, though. Or add a normal PHP include/require if you prefer to split them up.
[eluser]codeigniterzzz[/eluser]
[quote author="Aken" date="1352418795"]If you add the Frontend_Controller class to the MY_Controller.php file, does it work? CI doesn't know to include that file, since there is no auto-load. It's only set up to load MY_Controller. You can put all of your base controllers in that one file, though. Or add a normal PHP include/require if you prefer to split them up.[/quote] So what ur suggesting is something like this: Code: <?php if (!defined('BASEPATH')) exit('No direct script access allowed');
[eluser]codeigniterzzz[/eluser]
actually aken ur right, i literally have to include the Frontend_Controller in the same file as MY_Controller. Then I can extend it...The luckyfella was right, i was for some reason assuming i can place each controller extending MY_Controller in separate files...
[eluser]CroNiX[/eluser]
Not if you create an autoloader. http://ellislab.com/forums/viewthread/218183/
[eluser]LuckyFella73[/eluser]
Quote:Not if you create an autoloader. My fault, I forgot to mention that ... I allways use a prepared config.php when starting a new project so I missed that one. @codeigniterzzz I would prefer to use this autoload instead of manually include the classes. If you have PHP 5.3+ installed use this one (Phil Sturgeon and Kenneth Vogt): Code: /* Otherwise this one (Phil Sturgeon): Code: /* Place it at the bottom of application/config/config.php |
Welcome Guest, Not a member yet? Register Sign In |