当前位置: 首页>>代码示例>>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;未经允许,请勿转载。