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
Implements Drupal\field\Plugin\Type\Formatter\FormatterInterface::view().
16 methods override FormatterInterface::viewElements()
DefaultNumberFormatter::viewElements in drupal/core/modules/field/modules/number/lib/Drupal/number/Plugin/field/formatter/DefaultNumberFormatter.php
Implements Drupal\field\Plugin\Type\Formatter\FormatterInterface::viewElements().
GenericFileFormatter::viewElements in drupal/core/modules/file/lib/Drupal/file/Plugin/field/formatter/GenericFileFormatter.php
Implements \Drupal\field\Plugin\Type\Formatter\FormatterInterface::viewElements().
ImageFormatter::viewElements in drupal/core/modules/image/lib/Drupal/image/Plugin/field/formatter/ImageFormatter.php
Implements \Drupal\field\Plugin\Type\Formatter\FormatterInterface::viewElements().
LegacyFormatter::viewElements in drupal/core/modules/field/lib/Drupal/field/Plugin/field/formatter/LegacyFormatter.php
Implements Drupal\field\Plugin\Type\Formatter\FormatterInterface::viewElements().
MailToFormatter::viewElements in drupal/core/modules/field/modules/email/lib/Drupal/email/Plugin/field/formatter/MailToFormatter.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
Definition of 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);