Field Formatter API

Define Field API formatter types.

Field API formatters specify how fields are displayed when the entity to which the field is attached is displayed. Fields of a given field type may be displayed using more than one formatter. In this case, the Field UI module allows the site builder to choose which formatter to use.

Formatters are Plugins managed by the Drupal\field\Plugin\Type\Formatter\FormatterPluginManager class. A formatter is implemented by providing a class that implements Drupal\field\Plugin\Type\Formatter\FormatterInterface (in most cases, by subclassing Drupal\field\Plugin\Type\Formatter\FormatterBase), and provides the proper annotation block.

See also

Field API

Field Types API

Field Widget API

Parent topics


drupal/core/modules/field/field.api.php, line 830


Namesort descending Location Description
hook_field_formatter_info_alter drupal/core/modules/field/field.api.php Perform alterations on Field API formatter types.