Welcome Guest, Not a member yet? Register   Sign In
IDEA: Controller Extended by Default
#1

(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/.
Reply


Messages In This Thread
IDEA: Controller Extended by Default - by MGatner - 03-18-2019, 07:28 AM



Theme © iAndrew 2016 - Forum software by © MyBB