Block.php

Same filename in this branch
  1. 8.9.x core/modules/views/src/Plugin/views/display/Block.php
  2. 8.9.x core/modules/block/src/Entity/Block.php
  3. 8.9.x core/modules/block/src/Plugin/migrate/source/Block.php
Same filename in other branches
  1. 9 core/modules/views/src/Plugin/views/display/Block.php
  2. 9 core/modules/block/src/Entity/Block.php
  3. 9 core/modules/block/src/Plugin/migrate/source/Block.php
  4. 9 core/lib/Drupal/Core/Block/Annotation/Block.php
  5. 10 core/modules/views/src/Plugin/views/display/Block.php
  6. 10 core/modules/block/src/Entity/Block.php
  7. 10 core/modules/block/src/Plugin/migrate/source/Block.php
  8. 10 core/lib/Drupal/Core/Block/Attribute/Block.php
  9. 10 core/lib/Drupal/Core/Block/Annotation/Block.php
  10. 11.x core/modules/views/src/Plugin/views/display/Block.php
  11. 11.x core/modules/block/src/Entity/Block.php
  12. 11.x core/modules/block/src/Plugin/migrate/source/Block.php
  13. 11.x core/lib/Drupal/Core/Block/Attribute/Block.php
  14. 11.x core/lib/Drupal/Core/Block/Annotation/Block.php

Namespace

Drupal\Core\Block\Annotation

File

core/lib/Drupal/Core/Block/Annotation/Block.php

View source
<?php

namespace Drupal\Core\Block\Annotation;

use Drupal\Component\Annotation\Plugin;

/**
 * Defines a Block annotation object.
 *
 * @ingroup block_api
 *
 * @Annotation
 */
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 = [];

}

Classes

Title Deprecated Summary
Block Defines a Block annotation object.

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