![]() |
I'd like to stop referencing the dependency injection container (DIC). I'm force to do this, because the controller is created with the new keyword. If I could override this behavior and have the DIC create the controller, I can get the dependencies I need by adding them to the constructor.
For example PHP Code: //what I currently have to do I do have a branch https://github.com/eavMarshall/CodeIgniter4 that should allow me to do this, by adding a common function that can be overwritten |
Messages In This Thread |
A way to override the instantiation of the controller - by eavmarshall - 02-27-2021, 11:14 AM
RE: A way to override the instantiation of the controller - by kenjis - 02-27-2021, 10:34 PM
RE: A way to override the instantiation of the controller - by eavmarshall - 02-27-2021, 11:34 PM
RE: A way to override the instantiation of the controller - by kenjis - 02-28-2021, 05:14 PM
RE: A way to override the instantiation of the controller - by MGatner - 02-28-2021, 09:29 AM
RE: A way to override the instantiation of the controller - by kenjis - 03-01-2021, 04:22 PM
RE: A way to override the instantiation of the controller - by eavmarshall - 03-08-2021, 11:29 AM
RE: A way to override the instantiation of the controller - by kenjis - 03-13-2021, 01:54 AM
RE: A way to override the instantiation of the controller - by kenjis - 03-13-2021, 06:48 PM
|