Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Block.php

class Block

Same name in this branch
  1. 11.1.x vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Block.php \PhpParser\Node\Stmt\Block
  2. 11.1.x core/lib/Drupal/Core/Block/Attribute/Block.php \Drupal\Core\Block\Attribute\Block
  3. 11.1.x core/modules/views/src/Plugin/views/display/Block.php \Drupal\views\Plugin\views\display\Block
  4. 11.1.x core/modules/block/src/Plugin/migrate/source/Block.php \Drupal\block\Plugin\migrate\source\Block
  5. 11.1.x core/modules/block/src/Entity/Block.php \Drupal\block\Entity\Block

Defines a Block annotation object.

Hierarchy

  • class \Drupal\Component\Annotation\Plugin implements \Drupal\Component\Annotation\AnnotationInterface
    • class \Drupal\Core\Block\Annotation\Block extends \Drupal\Component\Annotation\Plugin

Expanded class hierarchy of Block

Related topics

Block API
Information about the classes and interfaces that make up the Block API.
Annotations
Annotations for class discovery and metadata description.
81 string references to 'Block'
big_pipe_theme_suggestions_big_pipe_interface_preview in core/modules/big_pipe/big_pipe.module
Implements hook_theme_suggestions_HOOK().
block.info.yml in core/modules/block/block.info.yml
core/modules/block/block.info.yml
block.links.contextual.yml in core/modules/block/block.links.contextual.yml
core/modules/block/block.links.contextual.yml
block.migrate_drupal.yml in core/modules/block/migrations/state/block.migrate_drupal.yml
core/modules/block/migrations/state/block.migrate_drupal.yml
block.schema.yml in core/modules/block/config/schema/block.schema.yml
core/modules/block/config/schema/block.schema.yml

... See full list

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[]
     */
    public $context_definitions = [];

}

Members

Title Sort descending 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_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 1
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 1
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. 3
RSS feed
Powered by Drupal