IDEA: Controller Extended by Default |
03-18-2019, 07:28 AM
(This post was last modified: 03-18-2019, 07:34 AM by MGatner. Edit Reason: location comment )
I've been reading on the forums a lot, and one thing I keep seeing: there are a lot of requests solved by extending the controller and then using a new base controller to recreate some of the CI3-style "autoload". From a development standpoint, it makes sense to extend the controller initially even if you don't have any modifications to the base yet since making the change down the road involves going back and editing every controller.
So, would it make sense to ship with a basic extended Controller (e.g. app/BaseController.php) that was used by app/Controllers/Home.php and recommended by the User Guide? Doesn't seem that it would cost anything and would set many people up for a best practice. (reference: https://codeigniter4.github.io/CodeIgnit...re-classes) EDIT: I suppose a better location would be something like app/Libraries/BaseController.php, or in a new folder like "Core" or "Extensions" in app/. |
Messages In This Thread |
IDEA: Controller Extended by Default - by MGatner - 03-18-2019, 07:28 AM
RE: IDEA: Controller Extended by Default - by InsiteFX - 03-18-2019, 08:18 AM
RE: IDEA: Controller Extended by Default - by titounnes - 03-19-2019, 03:08 AM
RE: IDEA: Controller Extended by Default - by kilishan - 03-18-2019, 09:55 AM
RE: IDEA: Controller Extended by Default - by MGatner - 03-18-2019, 12:27 PM
RE: IDEA: Controller Extended by Default - by MGatner - 03-19-2019, 07:25 AM
RE: IDEA: Controller Extended by Default - by kilishan - 03-19-2019, 08:07 PM
RE: IDEA: Controller Extended by Default - by MGatner - 03-20-2019, 08:07 AM
RE: IDEA: Controller Extended by Default - by kilishan - 03-20-2019, 08:40 AM
RE: IDEA: Controller Extended by Default - by MGatner - 03-20-2019, 10:23 AM
RE: IDEA: Controller Extended by Default - by MGatner - 03-20-2019, 11:10 AM
|