DisplayVariant.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. namespace Drupal\Core\Display\Annotation;
  3. use Drupal\Component\Annotation\Plugin;
  4. /**
  5. * Defines a display variant annotation object.
  6. *
  7. * Display variants are used to dictate the output of a given Display, which
  8. * can be used to control the output of many parts of Drupal.
  9. *
  10. * Variants are usually chosen by some selection criteria, and are instantiated
  11. * directly. Each variant must define its own approach to rendering, and can
  12. * either load its own data or be injected with data from another Display
  13. * object.
  14. *
  15. * @todo: Revise description when/if Displays are added to core:
  16. * https://www.drupal.org/node/2292733
  17. *
  18. * Plugin namespace: Plugin\DisplayVariant
  19. *
  20. * For working examples, see
  21. * - \Drupal\Core\Render\Plugin\DisplayVariant\SimplePageVariant
  22. * - \Drupal\block\Plugin\DisplayVariant\BlockPageVariant
  23. *
  24. * @see \Drupal\Core\Display\VariantInterface
  25. * @see \Drupal\Core\Display\VariantBase
  26. * @see \Drupal\Core\Display\VariantManager
  27. * @see \Drupal\Core\Display\PageVariantInterface
  28. * @see plugin_api
  29. *
  30. * @Annotation
  31. */
  32. class DisplayVariant extends Plugin {
  33. /**
  34. * The plugin ID.
  35. *
  36. * @var string
  37. */
  38. public $id;
  39. /**
  40. * The administrative label.
  41. *
  42. * @var \Drupal\Core\Annotation\Translation
  43. *
  44. * @ingroup plugin_translatable
  45. */
  46. public $admin_label = '';
  47. }