Welcome Guest, Not a member yet? Register   Sign In
User configurable controller factory
#3

What people could use it for: at present it seems that CI4 only supports service location in a base controller class, which is fine but many people prefer to inject dependencies via the constructor. Moving the controller class instantiation into user space allows end-users to write factory classes or factory methods (located in, for example, app/Config/Services.php), allowing them to implement dependency injection as they see fit.

Thank you for being receptive and for the suggestion of sending a PR, I will likely to do so.
Reply


Messages In This Thread
RE: User configurable controller factory - by Alex2005 - 05-18-2019, 01:16 AM



Theme © iAndrew 2016 - Forum software by © MyBB