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


PHP BlockBase::__construct方法代碼示例

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


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

示例1: __construct

 /**
  * CircleBreadcrumbs constructor.
  */
 public function __construct(array $configuration, $plugin_id, $plugin_definition, MenuLinkManagerInterface $link, MenuActiveTrailInterface $active, $link_tree)
 {
     parent::__construct($configuration, $plugin_id, $plugin_definition);
     $this->linkManager = $link;
     $this->active = $active;
     $this->linkTree = $link_tree;
 }
開發者ID:danquah,項目名稱:forlevd8,代碼行數:10,代碼來源:CircleBreadcrumbs.php

示例2: __construct

 /**
  * Creates a HelpBlock instance.
  *
  * @param array $configuration
  *   A configuration array containing information about the plugin instance.
  * @param string $plugin_id
  *   The plugin_id for the plugin instance.
  * @param mixed $plugin_definition
  *   The plugin implementation definition.
  * @param \Symfony\Component\HttpFoundation\Request $request
  *   The current request.
  * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
  *   The module handler.
  * @param \Drupal\Core\Routing\RouteMatchInterface $route_match
  *   The current route match.
  */
 public function __construct(array $configuration, $plugin_id, $plugin_definition, Request $request, ModuleHandlerInterface $module_handler, RouteMatchInterface $route_match)
 {
     parent::__construct($configuration, $plugin_id, $plugin_definition);
     $this->request = $request;
     $this->moduleHandler = $module_handler;
     $this->routeMatch = $route_match;
 }
開發者ID:Nikola-xiii,項目名稱:d8intranet,代碼行數:23,代碼來源:HelpBlock.php

示例3: __construct

 /**
  * Constructs an SimplenewsSubscriptionBlock object.
  *
  * @param array $configuration
  *   A configuration array containing information about the plugin instance.
  * @param string $plugin_id
  *   The plugin_id for the plugin instance.
  * @param mixed $plugin_definition
  *   The plugin implementation definition.
  * @param \Drupal\Core\Entity\EntityStorageInterface; $newsletterStorage
  *   The storage object for newsletters.
  * @param \Drupal\Core\Form\FormBuilderInterface $formBuilder
  *   The form builder object.
  * @param \Drupal\Core\Entity\Query\QueryInterface $newsletterQuery
  *   The entity query object for newsletters.
  */
 public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityManagerInterface $entity_manager, FormBuilderInterface $formBuilder, QueryInterface $newsletterQuery)
 {
     parent::__construct($configuration, $plugin_id, $plugin_definition);
     $this->entityManager = $entity_manager;
     $this->formBuilder = $formBuilder;
     $this->newsletterQuery = $newsletterQuery;
 }
開發者ID:aritnath1990,項目名稱:simplenewslatest,代碼行數:23,代碼來源:SimplenewsSubscriptionBlock.php

示例4: __construct

 /**
  * Constructs a new SwitchUserBlock object.
  *
  * @param array $configuration
  *   A configuration array containing information about the plugin instance.
  * @param string $plugin_id
  *   The plugin_id for the plugin instance.
  * @param mixed $plugin_definition
  *   The plugin implementation definition.
  * @param \Drupal\Core\Session\AccountInterface $current_user
  *   Current user.
  * @param \Drupal\Core\Entity\EntityStorageInterface $user_storage
  *   The user storage.
  * @param \Drupal\Core\Form\FormBuilderInterface $form_builder
  *   The form builder service.
  */
 public function __construct(array $configuration, $plugin_id, $plugin_definition, AccountInterface $current_user, EntityStorageInterface $user_storage, FormBuilderInterface $form_builder)
 {
     parent::__construct($configuration, $plugin_id, $plugin_definition);
     $this->formBuilder = $form_builder;
     $this->currentUser = $current_user;
     $this->userStorage = $user_storage;
 }
開發者ID:AllieRays,項目名稱:debugging-drupal-8,代碼行數:23,代碼來源:SwitchUserBlock.php

示例5: __construct

 /**
  * Constructs an AggregatorFeedBlock object.
  *
  * @param array $configuration
  *   A configuration array containing information about the plugin instance.
  * @param string $plugin_id
  *   The plugin_id for the plugin instance.
  * @param mixed $plugin_definition
  *   The plugin implementation definition.
  * @param \Drupal\aggregator\FeedStorageInterface $feed_storage
  *   The entity storage for feeds.
  * @param \Drupal\aggregator\ItemStorageInterface $item_storage
  *   The entity storage for feed items.
  * @param \Drupal\Core\Entity\Query\QueryInterface $item_query
  *   The entity query object for feed items.
  */
 public function __construct(array $configuration, $plugin_id, $plugin_definition, FeedStorageInterface $feed_storage, ItemStorageInterface $item_storage, QueryInterface $item_query)
 {
     parent::__construct($configuration, $plugin_id, $plugin_definition);
     $this->feedStorage = $feed_storage;
     $this->itemStorage = $item_storage;
     $this->itemQuery = $item_query;
 }
開發者ID:aWEBoLabs,項目名稱:taxi,代碼行數:23,代碼來源:AggregatorFeedBlock.php

示例6: __construct

 /**
  * Creates a NodeBlock instance.
  *
  * @param array $configuration
  * @param string $plugin_id
  * @param mixed $plugin_definition
  * @param EntityManagerInterface $entity_manager
  */
 public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityManagerInterface $entity_manager)
 {
     parent::__construct($configuration, $plugin_id, $plugin_definition);
     $this->viewBuilder = $entity_manager->getViewBuilder('node');
     $this->nodeStorage = $entity_manager->getStorage('node');
     $this->node = $entity_manager->getStorage('node')->load($this->getDerivativeId());
 }
開發者ID:louhichi,項目名稱:d8-demo-modules,代碼行數:15,代碼來源:NodeBlock.php

示例7: __construct

 /**
  * Construct.
  *
  * @param array $configuration
  *   A configuration array containing information about the plugin instance.
  * @param string $plugin_id
  * @param mixed $plugin_definition
  * @param \Drupal\Core\Entity\EntityManager $entity_manager
  * @param \Drupal\Core\Entity\Query\QueryFactory $entity_query
  * @param \Drupal\Core\Entity\EntityFormBuilder $entity_form_builder
  */
 public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityManager $entity_manager, QueryFactory $entity_query, EntityFormBuilder $entity_form_builder)
 {
     parent::__construct($configuration, $plugin_id, $plugin_definition);
     $this->entity_manager = $entity_manager;
     $this->entity_query = $entity_query;
     $this->entity_form_builder = $entity_form_builder;
 }
開發者ID:WondrousLLC,項目名稱:contact_form_block,代碼行數:18,代碼來源:ContactFormBlock.php

示例8: __construct

 /**
  * {@inheritdoc}
  */
 public function __construct(array $configuration, $plugin_id, $plugin_definition)
 {
     parent::__construct($configuration, $plugin_id, $plugin_definition);
     $this->platformManager = \Drupal::service('plugin.manager.social_media_links.platform');
     $this->iconsetManager = \Drupal::service('plugin.manager.social_media_links.iconset');
     $this->iconsetFinderService = \Drupal::service('social_media_links.finder');
 }
開發者ID:neetumorwani,項目名稱:blogging,代碼行數:10,代碼來源:SocialMediaLinksBlock.php

示例9: __construct

 /**
  * Construct.
  *
  * @param array $configuration
  *   A configuration array containing information about the plugin instance.
  * @param string $plugin_id
  *   The plugin_id for the plugin instance.
  * @param string $plugin_definition
  *   The plugin implementation definition.
  *
  * Add type-hinted parameters for any services to be injected into this class
  * following the normal parameters.
  */
 public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityManager $entity_manager, QueryFactory $entity_query)
 {
     parent::__construct($configuration, $plugin_id, $plugin_definition);
     // Make each of injected service available as a variable in the class.
     $this->entity_manager = $entity_manager;
     $this->entity_query = $entity_query;
 }
開發者ID:Lullabot,項目名稱:challenge4,代碼行數:20,代碼來源:DemoBlock.php

示例10: __construct

 /**
  * Constructs a AddContentBlock object.
  *
  * @param array $configuration
  *   A configuration array containing information about the plugin instance.
  * @param string $plugin_id
  *   The plugin ID for the plugin instance.
  * @param string $plugin_definition
  *   The plugin implementation definition.
  * @param \Drupal\Core\Plugin\Context\ContextProviderInterface $collection_context
  *   The collection context.
  * @param \Drupal\Core\Plugin\Context\ContextProviderInterface $solution_context
  *   The solution context.
  */
 public function __construct(array $configuration, $plugin_id, $plugin_definition, ContextProviderInterface $collection_context, ContextProviderInterface $solution_context, ContextProviderInterface $asset_release_context)
 {
     parent::__construct($configuration, $plugin_id, $plugin_definition);
     $this->collectionContext = $collection_context;
     $this->solutionContext = $solution_context;
     $this->assetReleaseContext = $asset_release_context;
 }
開發者ID:ec-europa,項目名稱:joinup-dev,代碼行數:21,代碼來源:AddContentBlock.php

示例11: __construct

 /**
  * Constructs RecentContent class.
  *
  * @param array $configuration
  *   A configuration array containing information about the plugin instance.
  * @param string $plugin_id
  *   The plugin_id for the plugin instance.
  * @param string $plugin_definition
  *   The plugin implementation definition.
  * @param \Drupal\Core\Entity\Query\QueryFactory
  *   The entity query factory.
  * @param EntityTypeManagerInterface $entity_type_manager
  *   The entity type manager.
  * @param \Drupal\Core\Render\RendererInterface
  *   The renderer.
  */
 public function __construct(array $configuration, $plugin_id, $plugin_definition, QueryFactory $entity_query, EntityTypeManagerInterface $entity_type_manager, RendererInterface $renderer)
 {
     parent::__construct($configuration, $plugin_id, $plugin_definition);
     $this->entityQuery = $entity_query;
     $this->entityTypeManager = $entity_type_manager;
     $this->renderer = $renderer;
 }
開發者ID:wizzlern,項目名稱:cacheit,代碼行數:23,代碼來源:RecentContent.php

示例12: __construct

 /**
  * Constructs a new NodeFormBlock plugin
  *
  * @param array $configuration
  *   A configuration array containing information about the plugin instance.
  * @param string $plugin_id
  *   The plugin_id for the plugin instance.
  * @param mixed $plugin_definition
  *   The plugin implementation definition.
  * @param \Drupal\Core\Entity\EntityManagerInterface $entityManger
  *   The entity manager.
  * @param \Drupal\Core\Entity\EntityFormBuilderInterface $entityFormBuilder
  *   The entity form builder.
  */
 public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityManagerInterface $entityManager, EntityFormBuilderInterface $entityFormBuilder)
 {
     parent::__construct($configuration, $plugin_id, $plugin_definition);
     $this->setConfiguration($configuration);
     $this->entityManager = $entityManager;
     $this->entityFormBuilder = $entityFormBuilder;
 }
開發者ID:justincletus,項目名稱:webdrupalpro,代碼行數:21,代碼來源:NodeFormBlock.php

示例13: __construct

 /**
  * Constructs a new BookNavigationBlock instance.
  *
  * @param array $configuration
  *   A configuration array containing information about the plugin instance.
  * @param string $plugin_id
  *   The plugin_id for the plugin instance.
  * @param mixed $plugin_definition
  *   The plugin implementation definition.
  * @param \Symfony\Component\HttpFoundation\RequestStack $request_stack
  *   The request stack object.
  * @param \Drupal\book\BookManagerInterface $book_manager
  *   The book manager.
  * @param \Drupal\Core\Entity\EntityStorageInterface $node_storage
  *   The node storage.
  */
 public function __construct(array $configuration, $plugin_id, $plugin_definition, RequestStack $request_stack, BookManagerInterface $book_manager, EntityStorageInterface $node_storage)
 {
     parent::__construct($configuration, $plugin_id, $plugin_definition);
     $this->requestStack = $request_stack;
     $this->bookManager = $book_manager;
     $this->nodeStorage = $node_storage;
 }
開發者ID:sarahwillem,項目名稱:OD8,代碼行數:23,代碼來源:BookNavigationBlock.php

示例14: __construct

 /**
  * Constructs a new DevelSwitchUser object.
  *
  * @param array $configuration
  *   A configuration array containing information about the plugin instance.
  * @param string $plugin_id
  *   The plugin_id for the plugin instance.
  * @param mixed $plugin_definition
  *   The plugin implementation definition.
  * @param \Drupal\Core\Access\CsrfTokenGenerator $csrf_token_generator
  * @param \Drupal\Core\Form\FormBuilderInterface $form_builder
  * @param \Drupal\Core\Session\AccountProxyInterface $current_user
  */
 public function __construct(array $configuration, $plugin_id, $plugin_definition, CsrfTokenGenerator $csrf_token_generator, FormBuilderInterface $form_builder, AccountProxyInterface $current_user, RedirectDestinationInterface $redirect_destination)
 {
     parent::__construct($configuration, $plugin_id, $plugin_definition);
     $this->csrfTokenGenerator = $csrf_token_generator;
     $this->formBuilder = $form_builder;
     $this->currentUser = $current_user;
     $this->redirectDestination = $redirect_destination;
 }
開發者ID:slovak-drupal-association,項目名稱:dccs,代碼行數:21,代碼來源:DevelSwitchUser.php

示例15: __construct

 /**
  * Constructs a new DisqusBaseBlock.
  *
  * @param array $configuration
  *   A configuration array containing information about the plugin instance.
  * @param string $plugin_id
  *   The plugin ID for the plugin instance.
  * @param mixed $plugin_definition
  *   The plugin implementation definition.
  * @param \Drupal\Core\Routing\RouteMatchInterface $route_match
  *   The current route match.
  * @param \Drupal\disqus\DisqusCommentManager $disqus_manager
  *   The disqus comment manager object.
  * @param \Drupal\Core\Session\AccountInterface $current_user
  *   The account for which view access should be checked.
  * @param \Drupal\Core\Config\ImmutableConfig $disqus_config
  *   Disqus config object.
  */
 public function __construct(array $configuration, $plugin_id, $plugin_definition, RouteMatchInterface $route_match, DisqusCommentManager $disqus_manager, AccountInterface $current_user, ImmutableConfig $disqus_config)
 {
     parent::__construct($configuration, $plugin_id, $plugin_definition);
     $this->currentUser = $current_user;
     $this->disqusManager = $disqus_manager;
     $this->routeMatch = $route_match;
     $this->disqusConfig = $disqus_config;
 }
開發者ID:hugronaphor,項目名稱:cornel,代碼行數:26,代碼來源:DisqusBaseBlock.php


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