当前位置: 首页>>代码示例>>PHP>>正文


PHP ModuleEvent::setParam方法代码示例

本文整理汇总了PHP中Zend\ModuleManager\ModuleEvent::setParam方法的典型用法代码示例。如果您正苦于以下问题:PHP ModuleEvent::setParam方法的具体用法?PHP ModuleEvent::setParam怎么用?PHP ModuleEvent::setParam使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend\ModuleManager\ModuleEvent的用法示例。


在下文中一共展示了ModuleEvent::setParam方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: createService

 /**
  * Creates and returns the module manager
  *
  * Instantiates the default module listeners, providing them configuration
  * from the "module_listener_options" key of the ApplicationConfig
  * service. Also sets the default config glob path.
  *
  * Module manager is instantiated and provided with an EventManager, to which
  * the default listener aggregate is attached. The ModuleEvent is also created
  * and attached to the module manager.
  *
  * @param  ServiceLocatorInterface $serviceLocator
  * @return ModuleManager
  */
 public function createService(ServiceLocatorInterface $serviceLocator)
 {
     if (!$serviceLocator->has('ServiceListener')) {
         $serviceLocator->setFactory('ServiceListener', 'HumusMvc\\Service\\ServiceListenerFactory');
     }
     if (!$serviceLocator->has('Zf1MvcListener')) {
         $serviceLocator->setFactory('Zf1MvcListener', 'HumusMvc\\Service\\Zf1MvcListenerFactory');
     }
     $configuration = $serviceLocator->get('ApplicationConfig');
     $listenerOptions = new ListenerOptions($configuration['module_listener_options']);
     $defaultListeners = new DefaultListenerAggregate($listenerOptions);
     $serviceListener = $serviceLocator->get('ServiceListener');
     $serviceListener->addServiceManager($serviceLocator, 'service_manager', 'Zend\\ModuleManager\\Feature\\ServiceProviderInterface', 'getServiceConfig');
     $serviceListener->addServiceManager('ViewHelperManager', 'view_helpers', 'Zend\\ModuleManager\\Feature\\ViewHelperProviderInterface', 'getViewHelperConfig');
     $serviceListener->addServiceManager('ActionHelperManager', 'action_helpers', 'HumusMvc\\ModuleManager\\Feature\\ActionHelperProviderInterface', 'getActionHelperConfig');
     $events = $serviceLocator->get('EventManager');
     $events->attach($defaultListeners);
     $events->attach($serviceListener);
     $sharedEvents = $events->getSharedManager();
     $sharedEvents->attach('HumusMvc\\Application', 'bootstrap', new LocaleListener());
     $moduleEvent = new ModuleEvent();
     $moduleEvent->setParam('ServiceManager', $serviceLocator);
     $moduleManager = new ModuleManager($configuration['modules'], $events);
     $moduleManager->setEvent($moduleEvent);
     return $moduleManager;
 }
开发者ID:xemlock,项目名称:HumusMvc,代码行数:40,代码来源:ModuleManagerFactory.php

示例2: createService

 /**
  * Creates and returns the module manager
  *
  * Instantiates the default module listeners, providing them configuration
  * from the "module_listener_options" key of the ApplicationConfig
  * service. Also sets the default config glob path.
  *
  * Module manager is instantiated and provided with an EventManager, to which
  * the default listener aggregate is attached. The ModuleEvent is also created
  * and attached to the module manager.
  *
  * @param  ServiceLocatorInterface $serviceLocator
  * @return ModuleManager
  */
 public function createService(ServiceLocatorInterface $serviceLocator)
 {
     if (!$serviceLocator->has('ServiceListener')) {
         $serviceLocator->setFactory('ServiceListener', 'Zend\\Mvc\\Service\\ServiceListenerFactory');
     }
     $configuration = $serviceLocator->get('ApplicationConfig');
     $listenerOptions = new ListenerOptions($configuration['module_listener_options']);
     $defaultListeners = new DefaultListenerAggregate($listenerOptions);
     $serviceListener = $serviceLocator->get('ServiceListener');
     $serviceListener->addServiceManager($serviceLocator, 'service_manager', 'Zend\\ModuleManager\\Feature\\ServiceProviderInterface', 'getServiceConfig');
     $serviceListener->addServiceManager('ControllerLoader', 'controllers', 'Zend\\ModuleManager\\Feature\\ControllerProviderInterface', 'getControllerConfig');
     $serviceListener->addServiceManager('ControllerPluginManager', 'controller_plugins', 'Zend\\ModuleManager\\Feature\\ControllerPluginProviderInterface', 'getControllerPluginConfig');
     $serviceListener->addServiceManager('ViewHelperManager', 'view_helpers', 'Zend\\ModuleManager\\Feature\\ViewHelperProviderInterface', 'getViewHelperConfig');
     $serviceListener->addServiceManager('ValidatorManager', 'validators', 'Zend\\ModuleManager\\Feature\\ValidatorProviderInterface', 'getValidatorConfig');
     $serviceListener->addServiceManager('FilterManager', 'filters', 'Zend\\ModuleManager\\Feature\\FilterProviderInterface', 'getFilterConfig');
     $serviceListener->addServiceManager('FormElementManager', 'form_elements', 'Zend\\ModuleManager\\Feature\\FormElementProviderInterface', 'getFormElementConfig');
     $serviceListener->addServiceManager('RoutePluginManager', 'route_manager', 'Zend\\ModuleManager\\Feature\\RouteProviderInterface', 'getRouteConfig');
     $serviceListener->addServiceManager('SerializerAdapterManager', 'serializers', 'Zend\\ModuleManager\\Feature\\SerializerProviderInterface', 'getSerializerConfig');
     $serviceListener->addServiceManager('HydratorManager', 'hydrators', 'Zend\\ModuleManager\\Feature\\HydratorProviderInterface', 'getHydratorConfig');
     $serviceListener->addServiceManager('InputFilterManager', 'input_filters', 'Zend\\ModuleManager\\Feature\\InputFilterProviderInterface', 'getInputFilterConfig');
     $serviceListener->addServiceManager('LogProcessorManager', 'log_processors', 'Zend\\ModuleManager\\Feature\\LogProcessorProviderInterface', 'getLogProcessorConfig');
     $serviceListener->addServiceManager('LogWriterManager', 'log_writers', 'Zend\\ModuleManager\\Feature\\LogWritersProviderInterface', 'getLogWriterConfig');
     $events = $serviceLocator->get('EventManager');
     $events->attach($defaultListeners);
     $events->attach($serviceListener);
     $moduleEvent = new ModuleEvent();
     $moduleEvent->setParam('ServiceManager', $serviceLocator);
     $moduleManager = new ModuleManager($configuration['modules'], $events);
     $moduleManager->setEvent($moduleEvent);
     return $moduleManager;
 }
开发者ID:JeoffScott,项目名称:dyplom,代码行数:45,代码来源:ModuleManagerFactory.php

示例3: createService

 /**
  * Creates and returns the module manager
  *
  * Instantiates the default module listeners, providing them configuration
  * from the "module_listener_options" key of the ApplicationConfig
  * service. Also sets the default config glob path.
  *
  * Module manager is instantiated and provided with an EventManager, to which
  * the default listener aggregate is attached. The ModuleEvent is also created
  * and attached to the module manager.
  *
  * @param  ServiceLocatorInterface $serviceLocator
  * @return ModuleManager
  */
 public function createService(ServiceLocatorInterface $serviceLocator)
 {
     if (!$serviceLocator->has('ServiceListener')) {
         $serviceLocator->setFactory('ServiceListener', 'Console\\Service\\ServiceListenerFactory');
     }
     $configuration = $serviceLocator->get('ApplicationConfig');
     $listenerOptions = new ListenerOptions($configuration['module_listener_options']);
     $defaultListeners = new DefaultListenerAggregate($listenerOptions);
     $serviceListener = $serviceLocator->get('ServiceListener');
     $serviceListener->addServiceManager($serviceLocator, 'service_manager', 'Zend\\ModuleManager\\Feature\\ServiceProviderInterface', 'getServiceConfig');
     $serviceListener->addServiceManager('ValidatorManager', 'validators', 'Zend\\ModuleManager\\Feature\\ValidatorProviderInterface', 'getValidatorConfig');
     $serviceListener->addServiceManager('FilterManager', 'filters', 'Zend\\ModuleManager\\Feature\\FilterProviderInterface', 'getFilterConfig');
     $serviceListener->addServiceManager('SerializerAdapterManager', 'serializers', 'Zend\\ModuleManager\\Feature\\SerializerProviderInterface', 'getSerializerConfig');
     $serviceListener->addServiceManager('SerializerAdapterManager', 'serializers', 'Zend\\ModuleManager\\Feature\\SerializerProviderInterface', 'getSerializerConfig');
     $serviceListener->addServiceManager('HydratorManager', 'hydrators', 'Zend\\ModuleManager\\Feature\\HydratorProviderInterface', 'getHydratorConfig');
     $serviceListener->addServiceManager('InputFilterManager', 'input_filters', 'Zend\\ModuleManager\\Feature\\InputFilterProviderInterface', 'getInputFilterConfig');
     $events = $serviceLocator->get('EventManager');
     $events->attach($defaultListeners);
     $events->attach($serviceListener);
     $moduleEvent = new ModuleEvent();
     $moduleEvent->setParam('ServiceManager', $serviceLocator);
     $moduleManager = new ModuleManager($configuration['modules'], $events);
     $moduleManager->setEvent($moduleEvent);
     return $moduleManager;
 }
开发者ID:scottasmith,项目名称:zf2-orm-app,代码行数:39,代码来源:ModuleManagerFactory.php

示例4: testInitRegistersPluginManager

 public function testInitRegistersPluginManager()
 {
     $event = new ModuleEvent();
     $event->setParam('ServiceManager', $this->serviceLocator);
     $this->moduleManager->expects(self::any())->method('getEvent')->willReturn($event);
     $this->serviceLocator->setService('ServiceListener', $this->serviceListener);
     $this->serviceListener->expects(self::atLeastOnce())->method('addServiceManager');
     $actual = $this->sut->init($this->moduleManager);
     self::assertNull($actual);
 }
开发者ID:abacaphiliac,项目名称:zend-eventmanager-pluginmanager,代码行数:10,代码来源:ModuleTest.php

示例5: createService

 /**
  * Creates and returns the module manager
  *
  * Instantiates the default module listeners, providing them configuration
  * from the "module_listener_options" key of the ApplicationConfiguration
  * service. Also sets the default config glob path.
  *
  * Module manager is instantiated and provided with an EventManager, to which
  * the default listener aggregate is attached. The ModuleEvent is also created
  * and attached to the module manager.
  *
  * @param  ServiceLocatorInterface $serviceLocator
  * @return ModuleManager
  */
 public function createService(ServiceLocatorInterface $serviceLocator)
 {
     $configuration = $serviceLocator->get('ApplicationConfiguration');
     $listenerOptions = new ListenerOptions($configuration['module_listener_options']);
     $defaultListeners = new DefaultListenerAggregate($listenerOptions);
     $serviceListener = new ServiceListener($serviceLocator, $this->defaultServiceConfiguration);
     $serviceListener->addServiceManager($serviceLocator, 'service_manager', 'Zend\\ModuleManager\\Feature\\ServiceProviderInterface', 'getServiceConfiguration');
     $serviceListener->addServiceManager('ControllerLoader', 'controllers', 'Zend\\ModuleManager\\Feature\\ControllerProviderInterface', 'getControllerConfiguration');
     $serviceListener->addServiceManager('ControllerPluginManager', 'controller_plugins', 'Zend\\ModuleManager\\Feature\\ControllerPluginProviderInterface', 'getControllerPluginConfiguration');
     $serviceListener->addServiceManager('ViewHelperManager', 'view_helpers', 'Zend\\ModuleManager\\Feature\\ViewHelperProviderInterface', 'getViewHelperConfiguration');
     $events = $serviceLocator->get('EventManager');
     $events->attach($defaultListeners);
     $events->attach($serviceListener);
     $moduleEvent = new ModuleEvent();
     $moduleEvent->setParam('ServiceManager', $serviceLocator);
     $moduleManager = new ModuleManager($configuration['modules'], $events);
     $moduleManager->setEvent($moduleEvent);
     return $moduleManager;
 }
开发者ID:robertodormepoco,项目名称:zf2,代码行数:33,代码来源:ModuleManagerFactory.php

示例6: createService

 /**
  * Creates and returns the module manager.
  *
  * Instantiates the default module listeners, providing them configuration
  * from the "module_listener_options" key of the ApplicationConfig
  * service. Also sets the default config glob path.
  *
  * Module manager is instantiated and provided with an EventManager, to which
  * the default listener aggregate is attached. The ModuleEvent is also created
  * and attached to the module manager.
  *
  * @param ServiceLocatorInterface $serviceLocator
  *
  * @return ModuleManager
  */
 public function createService(ServiceLocatorInterface $serviceLocator)
 {
     if (!$serviceLocator->has('ServiceListener')) {
         $serviceLocator->setFactory('ServiceListener', 'PPI\\Framework\\ServiceManager\\Factory\\ServiceListenerFactory');
     }
     $config = $serviceLocator->get('ApplicationConfig');
     $defaultListeners = $serviceLocator->get('ModuleDefaultListener');
     $serviceListener = $serviceLocator->get('ServiceListener');
     $serviceListener->addServiceManager($serviceLocator, 'service_manager', 'Zend\\ModuleManager\\Feature\\ServiceProviderInterface', 'getServiceConfig');
     $serviceListener->addServiceManager('RoutePluginManager', 'route_manager', 'Zend\\ModuleManager\\Feature\\RouteProviderInterface', 'getRouteConfig');
     $modules = isset($config['modules']['active_modules']) ? $config['modules']['active_modules'] : array();
     $events = $serviceLocator->get('EventManager');
     $events->attach($defaultListeners);
     $events->attach($serviceListener);
     $moduleEvent = new ModuleEvent();
     $moduleEvent->setParam('ServiceManager', $serviceLocator);
     $moduleManager = new ModuleManager($modules, $events);
     $moduleManager->setEvent($moduleEvent);
     return $moduleManager;
 }
开发者ID:BeastModeON,项目名称:framework,代码行数:35,代码来源:ModuleManagerFactory.php

示例7: __invoke

 /**
  * Creates and returns the module manager
  *
  * Instantiates the default module listeners, providing them configuration
  * from the "module_listener_options" key of the ApplicationConfig
  * service. Also sets the default config glob path.
  *
  * Module manager is instantiated and provided with an EventManager, to which
  * the default listener aggregate is attached. The ModuleEvent is also created
  * and attached to the module manager.
  *
  * @param  ContainerInterface $container
  * @param  string $name
  * @param  null|array $options
  * @return ModuleManager
  */
 public function __invoke(ContainerInterface $container, $name, array $options = null)
 {
     $configuration = $container->get('ApplicationConfig');
     $listenerOptions = new ListenerOptions($configuration['module_listener_options']);
     $defaultListeners = new DefaultListenerAggregate($listenerOptions);
     $serviceListener = $container->get('ServiceListener');
     $serviceListener->addServiceManager($container, 'service_manager', 'Zend\\ModuleManager\\Feature\\ServiceProviderInterface', 'getServiceConfig');
     $serviceListener->addServiceManager('ControllerManager', 'controllers', 'Zend\\ModuleManager\\Feature\\ControllerProviderInterface', 'getControllerConfig');
     $serviceListener->addServiceManager('ControllerPluginManager', 'controller_plugins', 'Zend\\ModuleManager\\Feature\\ControllerPluginProviderInterface', 'getControllerPluginConfig');
     $serviceListener->addServiceManager('ViewHelperManager', 'view_helpers', 'Zend\\ModuleManager\\Feature\\ViewHelperProviderInterface', 'getViewHelperConfig');
     $serviceListener->addServiceManager('RoutePluginManager', 'route_manager', 'Zend\\ModuleManager\\Feature\\RouteProviderInterface', 'getRouteConfig');
     $events = $container->get('EventManager');
     $defaultListeners->attach($events);
     $serviceListener->attach($events);
     $moduleEvent = new ModuleEvent();
     $moduleEvent->setParam('ServiceManager', $container);
     $moduleManager = new ModuleManager($configuration['modules'], $events);
     $moduleManager->setEvent($moduleEvent);
     return $moduleManager;
 }
开发者ID:zendframework,项目名称:zend-mvc,代码行数:36,代码来源:ModuleManagerFactory.php


注:本文中的Zend\ModuleManager\ModuleEvent::setParam方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。