public function onBootstrap(Event $e) { $sm = $e->getApplication()->getServiceManager(); $em = $sm->get('doctrine.entitymanager.orm_default'); $geoname = $sm->get('geoname'); $geoname->setEm($em)->registerCron(); }
public function onBootstrap(Event $e) { $app = $e->getApplication(); Utility::setSM($app->getServiceManager()); TransactionUtility::setSM($app->getServiceManager()); UnitCalcUtility::setSM($app->getServiceManager()); }
public function onBootstrap(Event $e) { $sm = $e->getApplication()->getServiceManager(); $em = $sm->get('doctrine.entitymanager.orm_default'); $vcard = $sm->get('vcard'); $vcard->setEm($em); }
public function onBootstrap(Event $event) { $application = $event->getApplication(); $serviceManager = $application->getServiceManager(); $view = $serviceManager->get('view'); $twigStrategy = $serviceManager->get('ViewTwigStrategy'); $view->getEventManager()->attach($twigStrategy, 100); }
/** * Load configuration * Change information to the ZF2 headTitle helper with informations of the plugin * @param Event $e */ public function loadConfiguration(Event $e) { $application = $e->getApplication(); $sm = $application->getServiceManager(); $viewHelperManager = $sm->get('viewHelperManager'); $plugin = $sm->get('ControllerPluginManager')->get('HeadTitle'); $headTitleHelper = $viewHelperManager->get('headTitle'); $headTitleHelper->set($plugin->getTitle()); }
/** * Bootstrap listener * * This is ran during the MVC bootstrap event because it requires access to * the DI container. * * @TODO: Check the application / locator / etc a bit better to make sure * the env looks how we're expecting it to? * @param Event $e * @return void */ public function onBootstrap(Event $e) { $application = $e->getApplication(); $services = $application->getServiceManager(); foreach ($this->modules as $module) { $moduleClassName = get_class($module); if (!$services->has($moduleClassName)) { $services->setService($moduleClassName, $module); } } }
public function onBootstrap(Event $e) { $app = $e->getApplication(); $app->getEventManager()->attach('dispatch', array($this, 'setLayout'), -100); }
public function onBootstrap(Event $e) { $application = $e->getApplication(); $serviceManager = $application->getServiceManager(); $this->setCacheAdapterToMapper($serviceManager); }