Here's what I'm using to integrate PHP-DI into ZF2 for now. I spent some quality time picking through the ZF2 event and listener system but ultimately couldn't find a graceful way to override Zend's DispatchListener. As a result, I've resorted to injecting when the controller's dispatch method is called, which is not ideal but is working well enough for me.
Here's what I'm using to integrate PHP-DI into ZF2 for now. I spent some quality time picking through the ZF2 event and listener system but ultimately couldn't find a graceful way to override Zend's DispatchListener. As a result, I've resorted to injecting when the controller's dispatch method is called, which is not ideal but is working well enough for me.