class Block

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

Defines a Block annotation object.

Hierarchy

Expanded class hierarchy of Block

Related topics

18 string references to 'Block'
BlockManager::getType in core/lib/Drupal/Core/Block/BlockManager.php
A string identifying the plugin type.
BlockManagerTest::setUp in core/tests/Drupal/Tests/Core/Block/BlockManagerTest.php
BlockTestBase::setUp in core/modules/block/src/Tests/BlockTestBase.php
Sets up a Drupal site for running functional and integration tests.
ConfigEntityDependencyTest::testWithDependencies in core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityDependencyTest.php
drupal-8.views-entity-views-data-2455125.yml in core/modules/system/tests/fixtures/update/drupal-8.views-entity-views-data-2455125.yml
core/modules/system/tests/fixtures/update/drupal-8.views-entity-views-data-2455125.yml

... See full list

4 classes are annotated with Block
Broken in core/lib/Drupal/Core/Block/Plugin/Block/Broken.php
Defines a fallback plugin for missing block plugins.
LocalActionsBlock in core/lib/Drupal/Core/Menu/Plugin/Block/LocalActionsBlock.php
Provides a block to display the local actions.
LocalTasksBlock in core/lib/Drupal/Core/Menu/Plugin/Block/LocalTasksBlock.php
Provides a "Tabs" block to display the local tasks.
PageTitleBlock in core/lib/Drupal/Core/Block/Plugin/Block/PageTitleBlock.php
Provides a block to display the page title.

File

core/lib/Drupal/Core/Block/Annotation/Block.php, line 14

Namespace

Drupal\Core\Block\Annotation
View source
class Block extends Plugin {
  
  /**
   * The plugin ID.
   *
   * @var string
   */
  public $id;
  
  /**
   * The administrative label of the block.
   *
   * @var \Drupal\Core\Annotation\Translation
   *
   * @ingroup plugin_translatable
   */
  public $admin_label = '';
  
  /**
   * The category in the admin UI where the block will be listed.
   *
   * @var \Drupal\Core\Annotation\Translation
   *
   * @ingroup plugin_translatable
   */
  public $category = '';
  
  /**
   * An array of context definitions describing the context used by the plugin.
   *
   * The array is keyed by context names.
   *
   * @var \Drupal\Core\Annotation\ContextDefinition[]
   *
   * @deprecated Providing context definitions via the "context" key is
   *   deprecated in Drupal 8.7.x and will be removed before Drupal 9.0.0. Use
   *   the "context_definitions" key instead.
   */
  public $context = [];
  
  /**
   * An array of context definitions describing the context used by the plugin.
   *
   * The array is keyed by context names.
   *
   * @var \Drupal\Core\Annotation\ContextDefinition[]
   */
  public $context_definitions = [];

}

Members

Title Sort descending Deprecated Modifiers Object type Summary Overriden Title Overrides
Block::$admin_label public property The administrative label of the block.
Block::$category public property The category in the admin UI where the block will be listed.
Block::$context Deprecated public property An array of context definitions describing the context used by the plugin.
Block::$context_definitions public property An array of context definitions describing the context used by the plugin.
Block::$id public property The plugin ID.
Plugin::$definition protected property The plugin definition read from the class annotation. 1
Plugin::get public function Gets the value of an annotation. Overrides AnnotationInterface::get 5
Plugin::getClass public function Gets the class of the annotated class. Overrides AnnotationInterface::getClass
Plugin::getId public function Gets the unique ID for this annotated class. Overrides AnnotationInterface::getId
Plugin::getProvider public function Gets the name of the provider of the annotated class. Overrides AnnotationInterface::getProvider 1
Plugin::parse protected function Parses an annotation into its definition.
Plugin::setClass public function Sets the class of the annotated class. Overrides AnnotationInterface::setClass
Plugin::setProvider public function Sets the name of the provider of the annotated class. Overrides AnnotationInterface::setProvider
Plugin::__construct public function Constructs a Plugin object. 2

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