public function FormatterInterface::viewElements

public FormatterInterface::viewElements(FieldItemListInterface $items, $langcode)

Builds a renderable array for a field value.

Parameters

\Drupal\Core\Field\FieldItemListInterface $items: The field values to be rendered.

string $langcode: The language that should be used to render the field.

Return value

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

File

core/lib/Drupal/Core/Field/FormatterInterface.php, line 88

Class

FormatterInterface
Interface definition for field formatter plugins.

Namespace

Drupal\Core\Field

Code

public function viewElements(FieldItemListInterface $items, $langcode);

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Field!FormatterInterface.php/function/FormatterInterface::viewElements/8.1.x