當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Event::getApplication方法代碼示例

本文整理匯總了PHP中Zend\EventManager\Event::getApplication方法的典型用法代碼示例。如果您正苦於以下問題:PHP Event::getApplication方法的具體用法?PHP Event::getApplication怎麽用?PHP Event::getApplication使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Zend\EventManager\Event的用法示例。


在下文中一共展示了Event::getApplication方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: onBootstrap

 public function onBootstrap(Event $e)
 {
     $sm = $e->getApplication()->getServiceManager();
     $em = $sm->get('doctrine.entitymanager.orm_default');
     $geoname = $sm->get('geoname');
     $geoname->setEm($em)->registerCron();
 }
開發者ID:heartsentwined,項目名稱:zf2-geoname,代碼行數:7,代碼來源:Module.php

示例2: onBootstrap

 public function onBootstrap(Event $e)
 {
     $app = $e->getApplication();
     Utility::setSM($app->getServiceManager());
     TransactionUtility::setSM($app->getServiceManager());
     UnitCalcUtility::setSM($app->getServiceManager());
 }
開發者ID:binnguyen,項目名稱:kaffabasic,代碼行數:7,代碼來源:Module.php

示例3: onBootstrap

 public function onBootstrap(Event $e)
 {
     $sm = $e->getApplication()->getServiceManager();
     $em = $sm->get('doctrine.entitymanager.orm_default');
     $vcard = $sm->get('vcard');
     $vcard->setEm($em);
 }
開發者ID:heartsentwined,項目名稱:zf2-vcard,代碼行數:7,代碼來源:Module.php

示例4: onBootstrap

 public function onBootstrap(Event $event)
 {
     $application = $event->getApplication();
     $serviceManager = $application->getServiceManager();
     $view = $serviceManager->get('view');
     $twigStrategy = $serviceManager->get('ViewTwigStrategy');
     $view->getEventManager()->attach($twigStrategy, 100);
 }
開發者ID:rhysr,項目名稱:ZF2Twig,代碼行數:8,代碼來源:Module.php

示例5: loadConfiguration

 /**
  * 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());
 }
開發者ID:trongle,項目名稱:zend-2,代碼行數:14,代碼來源:Module.php

示例6: onBootstrap

 /**
  * 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);
         }
     }
 }
開發者ID:gstearmit,項目名稱:EshopVegeTable,代碼行數:22,代碼來源:LocatorRegistrationListener.php

示例7: onBootstrap

 public function onBootstrap(Event $e)
 {
     $app = $e->getApplication();
     $app->getEventManager()->attach('dispatch', array($this, 'setLayout'), -100);
 }
開發者ID:heartsentwined,項目名稱:zf2-cron,代碼行數:5,代碼來源:Module.php

示例8: onBootstrap

 public function onBootstrap(Event $e)
 {
     $application = $e->getApplication();
     $serviceManager = $application->getServiceManager();
     $this->setCacheAdapterToMapper($serviceManager);
 }
開發者ID:ibekiaris,項目名稱:zf2-annotation-validator,代碼行數:6,代碼來源:Module.php


注:本文中的Zend\EventManager\Event::getApplication方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。