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


PHP AbstractPluginManager::__construct方法代碼示例

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


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

示例1: __construct

 /**
  * Constructor
  *
  * Overrides parent constructor in order to add the initializer methods injectFactory()
  * and callElementInit().
  *
  * @param null|ConfigInterface|ContainerInterface $configOrContainerInstance
  * @param array $v3config If $configOrContainerInstance is a container, this
  *     value will be passed to the parent constructor.
  */
 public function __construct($configInstanceOrParentLocator = null, array $v3config = [])
 {
     // Provide default initializers, ensuring correct order
     array_unshift($this->initializers, [$this, 'injectFactory']);
     array_push($this->initializers, [$this, 'callElementInit']);
     parent::__construct($configInstanceOrParentLocator, $v3config);
 }
開發者ID:zendframework,項目名稱:zend-form,代碼行數:17,代碼來源:FormElementManagerV2Polyfill.php

示例2: __construct

 /**
  * Constructor
  *
  * After invoking parent constructor, add an initializer to inject the
  * attached renderer and translator, if any, to the currently requested helper.
  *
  * @param null $configuration
  */
 public function __construct($configuration = null)
 {
     parent::__construct(null);
     Config::has('jquery', $configuration);
     $this->config = new Config($configuration['jquery'], $this->invokableClasses);
     $this->addInitializer(array($this, 'injectConfig'));
 }
開發者ID:pedro151,項目名稱:zfcomplement,代碼行數:15,代碼來源:JQueryPluginManager.php

示例3: __construct

 /**
  * @param null $configOrContainerInstance
  * @param array $v3config
  */
 public function __construct($configOrContainerInstance = null, array $v3config = [])
 {
     parent::__construct($configOrContainerInstance, $v3config);
     $this->addInitializer([$this, 'injectDbAdapter']);
     $this->addInitializer([$this, 'injectHydrator']);
     $this->addInitializer([$this, 'injectModel']);
 }
開發者ID:uthando-cms,項目名稱:uthando-common,代碼行數:11,代碼來源:MapperManager.php

示例4: __construct

 public function __construct(\Zend\ServiceManager\ConfigInterface $configuration = null)
 {
     parent::__construct($configuration);
     $this->setInvokableClass(self::GENERATOR_HUMAN, self::GENERATOR_HUMAN);
     $this->setInvokableClass(self::GENERATOR_HYBRID, self::GENERATOR_HYBRID);
     $this->setInvokableClass(self::GENERATOR_COMPUTER, self::GENERATOR_COMPUTER);
     $this->addInitializer(function (PasswordGeneratorInterface $instance, PluginManager $pm) {
         /* @var $options \XelaxPasswordGeneratorModule\Options\GeneratorOptions */
         $generatorOptions = $pm->getServiceLocator()->get('XelaxPasswordGeneratorModule\\Options\\Generator');
         $options = array();
         if (isset($generatorOptions->getGeneratorOptions()[get_class($instance)])) {
             $options = $generatorOptions->getGeneratorOptions()[get_class($instance)];
         }
         if (!empty($options['options'])) {
             foreach ($options['options'] as $key => $value) {
                 $instance->setOptionValue($key, $value);
             }
         }
         if (!empty($options['parameters'])) {
             foreach ($options['parameters'] as $key => $value) {
                 $instance->setParameter($key, $value);
             }
         }
     });
 }
開發者ID:abduluk98,項目名稱:password-generator-module,代碼行數:25,代碼來源:PluginManager.php

示例5: __construct

 public function __construct(ConfigInterface $config = null)
 {
     parent::__construct($config);
     foreach ($this->filters as $filterName => $filterClass) {
         $this->setInvokableClass($filterName, $filterClass);
     }
 }
開發者ID:robertdamoc,項目名稱:zf2-module-assets,代碼行數:7,代碼來源:AssetsFilterManager.php

示例6: __construct

 /**
  * Constructor
  *
  * Merges provided configuration with default configuration.
  *
  * Adds initializers to inject the attached renderer and translator, if
  * any, to the currently requested helper.
  *
  * @param null|ConfigInterface|ContainerInterface $configOrContainerInstance
  * @param array $v3config If $configOrContainerInstance is a container, this
  *     value will be passed to the parent constructor.
  */
 public function __construct($configOrContainerInstance = null, array $v3config = [])
 {
     $this->initializers[] = [$this, 'injectRenderer'];
     $this->initializers[] = [$this, 'injectTranslator'];
     $this->initializers[] = [$this, 'injectEventManager'];
     parent::__construct($configOrContainerInstance, $v3config);
 }
開發者ID:froschdesign,項目名稱:zend-view,代碼行數:19,代碼來源:HelperPluginManager.php

示例7: __construct

 /**
  * {@inheritDoc}
  */
 public function __construct(ConfigInterface $configuration = null)
 {
     parent::__construct($configuration);
     $this->addInitializer(function ($instance, $serviceLocator) {
         $instance->setServiceLocator($serviceLocator->getServiceLocator());
     }, false);
 }
開發者ID:patrova,項目名稱:omeka-s,代碼行數:10,代碼來源:Manager.php

示例8: __construct

 /**
  * Creates an instance.
  *
  * Adds two default initializers:
  * - Inject the translator to mails implementing TranslatorAwareInterface
  * - Call init() method on Mails if such method exists.
  *
  * @param ConfigInterface $configuration
  */
 public function __construct(ServiceLocatorInterface $serviceLocator, ConfigInterface $configuration = null)
 {
     parent::__construct($configuration);
     $this->serviceLocator = $serviceLocator;
     $self = $this;
     $this->addInitializer(function ($instance) use($self) {
         if ($instance instanceof TranslatorAwareInterface) {
             $translator = $self->getServiceLocator()->get('translator');
             $instance->setTranslator($translator);
             if (null === $instance->getTranslatorTextDomain()) {
                 $instance->setTranslatorTextDomain();
             }
             $instance->setTranslatorEnabled(true);
         }
     }, false);
     $this->addInitializer(function ($instance) {
         if (method_exists($instance, 'setServiceLocator')) {
             $instance->setServiceLocator($this);
         }
     }, false);
     $this->addInitializer(function ($instance) {
         if (method_exists($instance, 'init')) {
             $instance->init();
         }
     }, false);
 }
開發者ID:cross-solution,項目名稱:yawik,代碼行數:35,代碼來源:MailService.php

示例9: __construct

 /**
  * Creates an instance.
  *
  * {@inheritDoc}
  *
  * Adds an additional initializer to inject an event manager to assertions
  * implementing {@link EventManagerAwareInterface}.
  *
  */
 public function __construct(ServiceLocatorInterface $serviceLocator, ConfigInterface $configuration = null)
 {
     parent::__construct($configuration);
     $this->serviceLocator = $serviceLocator;
     // Pushing to bottom of stack to ensure this is done last
     $this->addInitializer(array($this, 'injectEventManager'), false);
 }
開發者ID:cross-solution,項目名稱:yawik,代碼行數:16,代碼來源:AssertionManager.php

示例10: __construct

 /**
  * Constructor
  *
  * Make sure table gateways are properly initialized.
  *
  * @param ConfigInterface $configuration Configuration settings (optional)
  */
 public function __construct(ConfigInterface $configuration = null)
 {
     parent::__construct($configuration);
     //todo: do we need an Initializer
     //$this->addInitializer(
     //    ['VuFind\ServiceManager\Initializer', 'initPlugin'], false
     //);
 }
開發者ID:swissbib,項目名稱:resources.swissbib.ch,代碼行數:15,代碼來源:AbstractPluginManager.php

示例11: __construct

 /**
  * Constructor
  *
  * After invoking parent constructor, add an initializer to inject the
  * attached renderer and translator, if any, to the currently requested helper.
  *
  * @param  null|ConfigInterface $configuration
  */
 public function __construct(ConfigInterface $configuration = null)
 {
     parent::__construct($configuration);
     $this->addInitializer(array($this, 'injectView'));
     if ($this->has('Navigation')) {
         $this->setInvokableClass('navigation', 'HumusMvc\\View\\Helper\\Navigation');
     }
 }
開發者ID:xemlock,項目名稱:HumusMvc,代碼行數:16,代碼來源:HelperPluginManager.php

示例12: __construct

 /**
  * __construct
  *
  * @param ConfigInterface $configuration
  * @param Renderer\RendererInterface $renderer
  */
 public function __construct(ConfigInterface $configuration = null, Renderer\RendererInterface $renderer = null)
 {
     parent::__construct($configuration);
     if ($renderer) {
         $this->setRenderer($renderer);
     }
     $this->addInitializer([$this, 'injectRenderer'])->addInitializer([$this, 'injectTranslator'])->addInitializer([$this, 'callInit'], false);
 }
開發者ID:coolms,項目名稱:jquery,代碼行數:14,代碼來源:JQueryPluginManager.php

示例13: __construct

 /**
  * Ctor
  * @param ConfigInterface $configuration
  */
 public function __construct(ConfigInterface $configuration = null)
 {
     parent::__construct($configuration);
     // FIXME: set its from config (not in the ctor)
     foreach ($this->invokableClasses as $key => $value) {
         $this->setInvokableClass($key, $value);
     }
     $this->addInitializer([$this, 'injectAdapter']);
 }
開發者ID:ripaclub,項目名稱:imgman,代碼行數:13,代碼來源:HelperPluginManager.php

示例14: __construct

 /**
  * {@inheritdoc}
  */
 public function __construct(ConfigInterface $configuration = null)
 {
     parent::__construct($configuration);
     if (!$configuration) {
         return;
     }
     Assertion::isInstanceOf($configuration, DataMapperManagerConfig::class);
     /* @var $configuration DataMapperManagerConfig */
     $this->entityDataMapperMap = $configuration->getEntityDataMapperMap();
 }
開發者ID:stefanotorresi,項目名稱:thorr-persistence,代碼行數:13,代碼來源:DataMapperManager.php

示例15: __construct

 /**
  * Constructor
  *
  * Add a default initializer to ensure the plugin is valid after instance
  * creation.
  *
  * Additionally, the constructor provides forwards compatibility with v3 by
  * overloading the initial argument. v2 usage expects either null or a
  * ConfigInterface instance, and will ignore any other arguments. v3 expects
  * a ContainerInterface instance, and will use an array of configuration to
  * seed the current instance with services. In most cases, you can ignore the
  * constructor unless you are writing a specialized factory for your plugin
  * manager or overriding it.
  *
  * @param null|ConfigInterface|ContainerInterface $configOrContainerInstance
  * @param array $v3config If $configOrContainerInstance is a container, this
  *     value will be passed to the parent constructor.
  * @throws Exception\InvalidArgumentException if $configOrContainerInstance
  *     is neither null, nor a ConfigInterface, nor a ContainerInterface.
  */
 public function __construct($configOrContainerInstance = null, array $v3config = [])
 {
     if (empty($v3config) && $configOrContainerInstance instanceof ContainerInterface) {
         $config = $configOrContainerInstance->get('Config');
         if (isset($config['migration_manager'])) {
             $v3config = $config['migration_manager'];
         }
     }
     parent::__construct($configOrContainerInstance, $v3config);
     $this->addInitializer([$this, 'dbAdapterInitializer'], false);
     $this->addInitializer([$this, 'consoleAdapterInitializer'], false);
 }
開發者ID:andrey-mokhov,項目名稱:anelegan-db,代碼行數:32,代碼來源:MigrationPluginManager.php


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