class Block

Same name in this branch
  1. 10 core/lib/Drupal/Core/Block/Annotation/Block.php \Drupal\Core\Block\Annotation\Block
Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Block/Annotation/Block.php \Drupal\Core\Block\Annotation\Block
  2. 8.9.x core/lib/Drupal/Core/Block/Annotation/Block.php \Drupal\Core\Block\Annotation\Block
  3. 11.x core/lib/Drupal/Core/Block/Attribute/Block.php \Drupal\Core\Block\Attribute\Block
  4. 11.x core/lib/Drupal/Core/Block/Annotation/Block.php \Drupal\Core\Block\Annotation\Block

The Block attribute.

Hierarchy

  • class \Drupal\Core\Block\Attribute\Block implements \Drupal\Component\Plugin\Attribute\Plugin

Expanded class hierarchy of Block

8 files declare their use of Block
BlockManager.php in core/lib/Drupal/Core/Block/BlockManager.php
Broken.php in core/lib/Drupal/Core/Block/Plugin/Block/Broken.php
LocalActionsBlock.php in core/lib/Drupal/Core/Menu/Plugin/Block/LocalActionsBlock.php
LocalTasksBlock.php in core/lib/Drupal/Core/Menu/Plugin/Block/LocalTasksBlock.php
NavigationMenuBlock.php in core/modules/navigation/src/Plugin/Block/NavigationMenuBlock.php

... See full list

13 string references to 'Block'
BigPipeInterfacePreviewThemeSuggestionsTest::setUp in core/modules/big_pipe/tests/src/Kernel/BigPipeInterfacePreviewThemeSuggestionsTest.php
BlockManager::getType in core/lib/Drupal/Core/Block/BlockManager.php
A string identifying the plugin type.
MappingTest::testMappingInterpretation in core/tests/Drupal/KernelTests/Config/Schema/MappingTest.php
@dataProvider providerMappingInterpretation
navigation_theme in core/modules/navigation/navigation.module
Implements hook_theme().
recipe.yml in core/recipes/core_recommended_admin_theme/recipe.yml
core/recipes/core_recommended_admin_theme/recipe.yml

... See full list

File

core/lib/Drupal/Core/Block/Attribute/Block.php, line 11

Namespace

Drupal\Core\Block\Attribute
View source
class Block extends Plugin {
  
  /**
   * Constructs a Block attribute.
   *
   * @param string $id
   *   The plugin ID.
   * @param \Drupal\Core\StringTranslation\TranslatableMarkup|null $admin_label
   *   The administrative label of the block.
   * @param \Drupal\Core\StringTranslation\TranslatableMarkup|null $category
   *   (optional) The category in the admin UI where the block will be listed.
   * @param \Drupal\Core\Plugin\Context\ContextDefinitionInterface[] $context_definitions
   *   (optional) An array of context definitions describing the context used by
   *   the plugin. The array is keyed by context names.
   * @param class-string|null $deriver
   *   (optional) The deriver class.
   * @param array<string, string|false> $forms
   *   (optional) An array of form class names or FALSE, keyed by a string.
   */
  public function __construct(public readonly string $id, public readonly ?TranslatableMarkup $admin_label = NULL, public readonly ?TranslatableMarkup $category = NULL, public readonly array $context_definitions = [], public readonly ?string $deriver = NULL, public readonly array $forms = []) {
  }

}

Members

Title Sort descending Modifiers Object type Summary
Block::__construct public function Constructs a Block attribute.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.