unlikelysource.com

Are there any code examples of using initializers with ServiceManager? It is clear that initializers are useful ... but exactly how are they used?


Are there any code examples of using initializers with ServiceManager? It is clear that initializers are useful ... but exactly how are they used?
A: [MWOP] In ZF2 itself, we do it for two things immediately:

* Any class that implements Zend\ServiceManager\ServiceLocatorAwareInterface
will be injected with the ServiceManager instance, via an initializer.
* Any class that implements Zend\EventManager\EventManagerAwareInterface
will be injected with an EventManager instance, via an initializer.

BACK

© 2018 unlikelysource.com | all rights reserved