public function FormatterInterface::viewElements

Builds a renderable array for a field value.

Parameters

Drupal\Core\Entity\EntityInterface $entity: The entity being displayed.

string $langcode: The language associated with $items.

array $items: Array of values for this field.

Return value

array A renderable array for $items, as an array of child elements keyed by numeric indexes starting from 0.

1 call to FormatterInterface::viewElements()
FormatterBase::view in drupal/core/modules/field/lib/Drupal/field/Plugin/Type/Formatter/FormatterBase.php
Builds a renderable array for one field on one entity instance.
26 methods override FormatterInterface::viewElements()
DateTimeDefaultFormatter::viewElements in drupal/core/modules/datetime/lib/Drupal/datetime/Plugin/field/formatter/DatetimeDefaultFormatter.php
Builds a renderable array for a field value.
DateTimePlainFormatter::viewElements in drupal/core/modules/datetime/lib/Drupal/datetime/Plugin/field/formatter/DatetimePlainFormatter.php
Implements Drupal\field\Plugin\Type\Formatter\FormatterInterface::viewElements().
DefaultNumberFormatter::viewElements in drupal/core/modules/number/lib/Drupal/number/Plugin/field/formatter/DefaultNumberFormatter.php
Builds a renderable array for a field value.
EntityReferenceFormatterBase::viewElements in drupal/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/field/formatter/EntityReferenceFormatterBase.php
Overrides \Drupal\field\Plugin\Type\Formatter\FormatterBase::viewElements().
GenericFileFormatter::viewElements in drupal/core/modules/file/lib/Drupal/file/Plugin/field/formatter/GenericFileFormatter.php
Implements \Drupal\field\Plugin\Type\Formatter\FormatterInterface::viewElements().

... See full list

File

drupal/core/modules/field/lib/Drupal/field/Plugin/Type/Formatter/FormatterInterface.php, line 106
Contains \Drupal\field\Plugin\Type\Formatter\FormatterInterface.

Class

FormatterInterface
Interface definition for field widget plugins.

Namespace

Drupal\field\Plugin\Type\Formatter

Code

public function viewElements(EntityInterface $entity, $langcode, array $items);