unlikelysource.com

Are there multiple module managers or is there only one as a singleton? When is the module manager created?


Are there multiple module managers or is there only one as a singleton?  When is the module manager created?
A: [MWOP] In the default ZF2 implementation, there's only one module manager, but
it's not a singleton. The instance is retrieved from the ServiceManager
as part of Application::init(), and this is also when loadModules() is
called. Because it is a shared instance, pulling it out of the
ServiceManager ensures you get the same instance each time.

If you don't use Application::init(), you either have to pull it from
the ServiceManager yourself, or instantiate it yourself.

BACK

© 2018 unlikelysource.com | all rights reserved