1. 8.3.x core/lib/Drupal/Core/Field/Annotation/FieldFormatter.php
  2. 8.0.x core/lib/Drupal/Core/Field/Annotation/FieldFormatter.php
  3. 8.1.x core/lib/Drupal/Core/Field/Annotation/FieldFormatter.php
  4. 8.2.x core/lib/Drupal/Core/Field/Annotation/FieldFormatter.php
  5. 8.4.x core/lib/Drupal/Core/Field/Annotation/FieldFormatter.php

Namespace

Drupal\Core\Field\Annotation

File

core/lib/Drupal/Core/Field/Annotation/FieldFormatter.php
View source
  1. <?php
  2. namespace Drupal\Core\Field\Annotation;
  3. use Drupal\Component\Annotation\Plugin;
  4. /**
  5. * Defines a FieldFormatter annotation object.
  6. *
  7. * Formatters handle the display of field values. They are typically
  8. * instantiated and invoked by an EntityDisplay object.
  9. *
  10. * Additional annotation keys for formatters can be defined in
  11. * hook_field_formatter_info_alter().
  12. *
  13. * @Annotation
  14. *
  15. * @see \Drupal\Core\Field\FormatterPluginManager
  16. * @see \Drupal\Core\Field\FormatterInterface
  17. *
  18. * @ingroup field_formatter
  19. */
  20. class FieldFormatter extends Plugin {
  21. /**
  22. * The plugin ID.
  23. *
  24. * @var string
  25. */
  26. public $id;
  27. /**
  28. * The human-readable name of the formatter type.
  29. *
  30. * @ingroup plugin_translatable
  31. *
  32. * @var \Drupal\Core\Annotation\Translation
  33. */
  34. public $label;
  35. /**
  36. * A short description of the formatter type.
  37. *
  38. * @ingroup plugin_translatable
  39. *
  40. * @var \Drupal\Core\Annotation\Translation
  41. */
  42. public $description;
  43. /**
  44. * The name of the field formatter class.
  45. *
  46. * This is not provided manually, it will be added by the discovery mechanism.
  47. *
  48. * @var string
  49. */
  50. public $class;
  51. /**
  52. * An array of field types the formatter supports.
  53. *
  54. * @var array
  55. */
  56. public $field_types = array();
  57. /**
  58. * An integer to determine the weight of this formatter relative to other
  59. * formatter in the Field UI when selecting a formatter for a given field
  60. * instance.
  61. *
  62. * @var int optional
  63. */
  64. public $weight = NULL;
  65. }

Classes

Namesort descending Description
FieldFormatter Defines a FieldFormatter annotation object.