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


PHP ModuleEvent::getParam方法代碼示例

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


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

示例1: initEvents

 /**
  * Init events
  * 
  * @param \Zend\ModuleManager\ModuleEvent $e
  */
 public function initEvents(ModuleEvent $e)
 {
     $model = $this->serviceLocator->get('Application\\Model\\ModelManager')->getInstance('ActionTracker\\Model\\ActionTrackerBase');
     $actions = $model->getActivatedActions();
     // bind all activated events
     if (count($actions)) {
         $eventManager = ActionTrackerEvent::getEventManager();
         foreach ($actions as $action) {
             $eventManager->attach($action->name, function ($e) use($model, $action) {
                 if ($model->getModuleInfo('ActionTracker')) {
                     $model->logAction($action->action_id, $e->getParam('description'), $e->getParam('description_params'));
                 }
             });
         }
     }
 }
開發者ID:esase,項目名稱:dream-cms-action-tracker-module,代碼行數:21,代碼來源:Module.php

示例2: onLoadModulesPost

 /**
  * Called when the modules are loaded.
  *
  * @param ModuleEvent $event
  */
 public function onLoadModulesPost(ModuleEvent $event)
 {
     /** @var ServiceManager $serviceManager */
     $serviceManager = $event->getParam('ServiceManager');
     /** @var EngineInterface $engine */
     $engine = $serviceManager->get('phpab.engine');
     $engine->start();
 }
開發者ID:phpab,項目名稱:phpab-module,代碼行數:13,代碼來源:Module.php

示例3: onLoadModules

 public function onLoadModules(ModuleEvent $event)
 {
     //        /** @var ModuleManager $moduleManager */
     //        $moduleManager = $event->getTarget();
     /** @var ServiceManager $serviceLocator */
     $serviceLocator = $event->getParam('ServiceManager');
     $serviceConfig = ArrayUtils::merge($this->getConfig(false)['service_manager'], $this->getServiceConfig());
     $serviceConfig = new ServiceConfig($serviceConfig);
     $serviceConfig->configureServiceManager($serviceLocator);
     /** @var \Detail\VarCrypt\Listener\MultiEncryptorListener $encryptorListener */
     $encryptorListener = $serviceLocator->get('Detail\\VarCrypt\\Listener\\MultiEncryptorListener');
     $encryptorListener->onLoadModules($event);
     //        $moduleManager->getEventManager()->attachAggregate($encryptorListener);
 }
開發者ID:detailnet,項目名稱:dfw-varcrypt-module,代碼行數:14,代碼來源:Module.php

示例4: overrideViewHelperUrl

 public function overrideViewHelperUrl(ModuleEvent $e)
 {
     $serviceLocator = $e->getParam('ServiceManager');
     $viewHelperManager = $serviceLocator->get('ViewHelperManager');
     // Configure URL view helper with router
     $viewHelperManager->setFactory('url', function ($sm) use($serviceLocator) {
         $helper = new View\Helper\Url();
         $router = \Zend\Console\Console::isConsole() ? 'HttpRouter' : 'Router';
         $helper->setRouter($serviceLocator->get($router));
         $match = $serviceLocator->get('application')->getMvcEvent()->getRouteMatch();
         if ($match instanceof \Zend\Mvc\Router\RouteMatch) {
             $helper->setRouteMatch($match);
         }
         return $helper;
     });
 }
開發者ID:joacub,項目名稱:libra-locale,代碼行數:16,代碼來源:Module.php

示例5: onLoadModule

 /**
  * Merge the config for each module
  *
  * @param  ModuleEvent $e
  * @return ConfigListener
  */
 public function onLoadModule(ModuleEvent $e)
 {
     $module = $e->getParam('module');
     if (!$module instanceof ConfigProviderInterface && !is_callable(array($module, 'getConfig'))) {
         return $this;
     }
     $config = $module->getConfig();
     $this->addConfig($e->getModuleName(), $config);
     return $this;
 }
開發者ID:robertodormepoco,項目名稱:zf2,代碼行數:16,代碼來源:ConfigListener.php


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