Better Autoloading - Extending core/MY_Controller.php |
(09-02-2015, 06:37 AM)mwhitney Wrote: It would probably be a good idea to add some code at the beginning of that autoloader to skip loading CI_ prefixed classes (and possibly classes with the configured subclass_prefix) to avoid causing issues when those classes are passed to your autoloader (for instance, when someone calls class_exists() without passing FALSE to the second parameter). I'm not married to the code, please feel free to fork the code and submit a PR or pop the snippet of code you want me to add here and I'll gladly add it. I had planned on writing a post for Composer setup and autoloading but perhaps next time... PS Thanks for the hint on composer_autoload in config.php, I learned something new today. I was gonna include the autoload file from the vendor folder so this keeps the config file cleaner. Thanks, Brendan |
Messages In This Thread |
Better Autoloading - Extending core/MY_Controller.php - by BrendanRehman - 09-01-2015, 11:54 AM
RE: Better Autoloading - Extending core/MY_Controller.php - by InsiteFX - 09-01-2015, 06:05 PM
RE: Better Autoloading - Extending core/MY_Controller.php - by mwhitney - 09-02-2015, 06:37 AM
RE: Better Autoloading - Extending core/MY_Controller.php - by BrendanRehman - 09-02-2015, 10:21 AM
|