Access to module config in Zend Framework 2
How I can get access to my module config from the controller? tomo I am really surprised at how obscure this is, because I had exactly the same problem and could not find a definitive answer. One would think the ZF2 documentation would say something about this. Anyhow, using trial and error, I came across this extremely simple answer: Inside controller functions: $config = $this->getServiceLocator()->get('Config'); Inside Module class functions (the Module.php file): $config = $e->getApplication()->getServiceManager()->get('Config'); whereas $e is an instance of Zend\Mvc\MvcEvent In general,