DisplayVariant.php 1.4 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
<?php

/**
 * @file
 * Contains \Drupal\Core\Display\Annotation\DisplayVariant.
 */

namespace Drupal\Core\Display\Annotation;

use Drupal\Component\Annotation\Plugin;

/**
 * Defines a display variant annotation object.
 *
 * Display variants are used to dictate the output of a given Display, which
 * can be used to control the output of many parts of Drupal. For example, the
 * FullPageVariant is used by the Block module to control regions and output
 * block content placed in those regions.
 *
 * Variants are usually chosen by some selection criteria, and are instantiated
 * directly. Each variant must define its own approach to rendering, and can
 * either load its own data or be injected with data from another Display
 * object.
 *
 * @todo: Revise description when/if Displays are added to core:
26 27 28 29 30 31
 *   https://www.drupal.org/node/2292733
 *
 * Plugin namespace: Plugin\DisplayVariant
 *
 * For a working example, see
 * \Drupal\block\Plugin\DisplayVariant\FullPageVariant
32 33
 *
 * @see \Drupal\Core\Display\VariantInterface
34
 * @see \Drupal\Core\Display\VariantBase
35
 * @see \Drupal\Core\Display\VariantManager
36
 * @see plugin_api
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
 *
 * @Annotation
 */
class DisplayVariant extends Plugin {

  /**
   * The plugin ID.
   *
   * @var string
   */
  public $id;

  /**
   * The administrative label.
   *
   * @var \Drupal\Core\Annotation\Translation
   *
   * @ingroup plugin_translatable
   */
  public $admin_label = '';

}