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


PHP DefaultPluginManager::createInstance方法代碼示例

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


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

示例1: createInstance

 /**
  * {@inheritdoc}
  */
 public function createInstance($plugin_id, array $configuration = [])
 {
     if (!$this->isPluginSupported($plugin_id)) {
         $plugin_id = $this->getFallbackPluginId($plugin_id);
     }
     return parent::createInstance($plugin_id, $configuration);
 }
開發者ID:sgtsaughter,項目名稱:d8portfolio,代碼行數:10,代碼來源:DevelDumperPluginManager.php

示例2: createInstance

 /**
  * {@inheritdoc}
  */
 public function createInstance($plugin_id, array $configuration = array())
 {
     if (!isset($configuration['theme'])) {
         $configuration['theme'] = $this->theme;
     }
     return parent::createInstance($plugin_id, $configuration);
 }
開發者ID:archual,項目名稱:drupal_materialize_theme,代碼行數:10,代碼來源:PluginManager.php

示例3: createInstance

 /**
  * {@inheritdoc}
  */
 public function createInstance($plugin_id, array $configuration = [])
 {
     // If a fully qualified event name is passed, be sure to get the base name
     // first.
     $plugin_id = $this->getEventBaseName($plugin_id);
     return parent::createInstance($plugin_id, $configuration);
 }
開發者ID:Progressable,項目名稱:openway8,代碼行數:10,代碼來源:RulesEventManager.php

示例4: createInstance

 /**
  * Overrides PluginManagerBase::createInstance().
  *
  * This method is overridden to set the request object when the resource
  * object is instantiated.
  */
 public function createInstance($plugin_id, array $configuration = array())
 {
     /* @var ResourceInterface $resource */
     $resource = parent::createInstance($plugin_id, $configuration);
     $resource->setRequest($this->request);
     return $resource;
 }
開發者ID:jhoffman-tm,項目名稱:waldorf-deployment,代碼行數:13,代碼來源:ResourcePluginManager.php

示例5: createInstance

 /**
  * {@inheritdoc}
  */
 public function createInstance($plugin_id, array $configuration = [])
 {
     $instance = parent::createInstance($plugin_id, $configuration);
     // Make sure that the instance has a UUID and generate one if necessary.
     if (!$instance->getUuid()) {
         $instance->setUuid($this->uuidService->generate());
     }
     return $instance;
 }
開發者ID:Progressable,項目名稱:openway8,代碼行數:12,代碼來源:ExpressionManager.php

示例6: createInstance

 /**
  * Overrides \Drupal\Component\Plugin\PluginManagerBase::createInstance().
  */
 public function createInstance($plugin_id, array $configuration = array())
 {
     // We want to provide a broken handler class whenever a class is not found.
     try {
         return parent::createInstance($plugin_id, $configuration);
     } catch (PluginException $e) {
         return new SelectionBroken($configuration['field_definition']);
     }
 }
開發者ID:anatalsceo,項目名稱:en-classe,代碼行數:12,代碼來源:SelectionPluginManager.php

示例7: createInstance

 /**
  * @param string $plugin_id
  * @param array $configuration
  *
  * @return object
  * @throws \Exception
  */
 public function createInstance($plugin_id, array $configuration = array()) {
   if (empty($configuration['route_name'])) {
     // @todo Also check for parameters?
     throw new \Exception('Route name is require configuration for GroupCreatorManager');
   }
   $route_name = $configuration['route_name'];
   /** @var \Drupal\Core\Routing\RouteProvider $route_provider */
   $route_provider = \Drupal::getContainer()->get('router.route_provider');
   $configuration['route'] = new RouteMatch($route_name, $route_provider->getRouteByName($route_name));
   unset($configuration['route_name']);
   return parent::createInstance($plugin_id, $configuration);
 }
開發者ID:eloiv,項目名稱:botafoc.cat,代碼行數:19,代碼來源:ConditionCreatorManager.php

示例8: createInstance

 /**
  * {@inheritdoc}
  */
 public function createInstance($plugin_id, array $configuration = array()) {
   $instance = parent::createInstance($plugin_id, $configuration);
   if ($instance instanceof HandlerBase) {
     $instance->setModuleHandler($this->moduleHandler);
     $instance->setViewsData($this->viewsData);
   }
   return $instance;
 }
開發者ID:jthoresen,項目名稱:PladsenDrupal,代碼行數:11,代碼來源:ViewsHandlerManager.php

示例9: createInstance

 /**
  * {@inheritdoc}
  *
  * @return \Drupal\Core\Queue\QueueWorkerInterface
  */
 public function createInstance($plugin_id, array $configuration = [])
 {
     return parent::createInstance($plugin_id, $configuration);
 }
開發者ID:aWEBoLabs,項目名稱:taxi,代碼行數:9,代碼來源:QueueWorkerManager.php

示例10: createInstance

 /**
  * {@inheritdoc}
  */
 public function createInstance($plugin_id, array $configuration = array())
 {
     $configuration += (array) $this->config->get('printable.format')->get($plugin_id);
     return parent::createInstance($plugin_id, $configuration);
 }
開發者ID:gerbreown1,項目名稱:calvaryfree,代碼行數:8,代碼來源:PrintableFormatPluginManager.php


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