예제 #1
0
 public function onBootstrap(Event $e)
 {
     $sm = $e->getApplication()->getServiceManager();
     $em = $sm->get('doctrine.entitymanager.orm_default');
     $geoname = $sm->get('geoname');
     $geoname->setEm($em)->registerCron();
 }
예제 #2
0
 public function onBootstrap(Event $e)
 {
     $app = $e->getApplication();
     Utility::setSM($app->getServiceManager());
     TransactionUtility::setSM($app->getServiceManager());
     UnitCalcUtility::setSM($app->getServiceManager());
 }
예제 #3
0
 public function onBootstrap(Event $e)
 {
     $sm = $e->getApplication()->getServiceManager();
     $em = $sm->get('doctrine.entitymanager.orm_default');
     $vcard = $sm->get('vcard');
     $vcard->setEm($em);
 }
예제 #4
0
파일: Module.php 프로젝트: rhysr/ZF2Twig
 public function onBootstrap(Event $event)
 {
     $application = $event->getApplication();
     $serviceManager = $application->getServiceManager();
     $view = $serviceManager->get('view');
     $twigStrategy = $serviceManager->get('ViewTwigStrategy');
     $view->getEventManager()->attach($twigStrategy, 100);
 }
예제 #5
0
파일: Module.php 프로젝트: trongle/zend-2
 /**
  * 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);
         }
     }
 }
예제 #7
0
 public function onBootstrap(Event $e)
 {
     $app = $e->getApplication();
     $app->getEventManager()->attach('dispatch', array($this, 'setLayout'), -100);
 }
예제 #8
0
 public function onBootstrap(Event $e)
 {
     $application = $e->getApplication();
     $serviceManager = $application->getServiceManager();
     $this->setCacheAdapterToMapper($serviceManager);
 }