I’m not offended at all. Just stating a fact.
CI conventions indicate that controllers and their ancestors provide core functionality they are not defined as libraries.
If you need a base controller you can create a core directory in your module and include the parent class as per your normal PHP directives or place them into the application/core directory to be autoloaded.
Also if you load a base controller as a library then you are instantiating a redundant controller instance which seems pointless.
In future it might be worth looking at the Modules::autoload() method to accommodate loading core files from modules too.
Alright awesome then =). I’m new to CI so correct me if I’m wrong. Btw, HMVC is a great addition to CI, I really do like it but of course, stuff needs to be modified when scaling out applications.
Including the parent class as per normal PHP directives defeats the purpose of having the class loaded through the CI system, I’d need to include the class into every controller I make within the module - this is why I wanted to have the class autoloaded since it will be used regardless for all controllers in the module. And placing my extended core classes into core defeats the purpose of individual modularity - and plus, I have other extensions of core classes using the “subclass_prefix.”
The Modules::autoload() function does not go to the depth of /module/module_name/core, but rather stays at application level. I’d need to modify this if I wanted this to look for a core folder within a module.
Just because a core class is placed in a “libraries” folder doesn’t mean that it has to act like a library. Would I rather put it in a folder called “core” for the sake of indicating it is a core class? Yes, I would love to lol.