|
|
This post has NOT been accepted by the mailing list yet.
I have a service which is instantiated via the Di and injected into a controller via a ServiceManager factory, which works just fine. However the trouble comes when I want to get this instance from an event (in this case Zend\Mvc\Application::route) that occurs prior to a controller being instantiated. This appears to be due to the DiServiceInitializer, which creates a proxy between the Di and ServiceManager in the ControllerLoaderFactory, not being available until a controller is requested. It seems to me that this proxy should be created earlier on in the Application process so it is usable in such events. Any thoughts?
|