W3cubDocs

/Drupal 8

public function FormatterInterface::view

public FormatterInterface::view(FieldItemListInterface $items, $langcode = NULL)

Builds a renderable array for a fully themed field.

Parameters

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

string $langcode: (optional) The language that should be used to render the field. Defaults to the current content language.

Return value

array A renderable array for a themed field with its label and all its values.

File

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

Class

FormatterInterface
Interface definition for field formatter plugins.

Namespace

Drupal\Core\Field

Code

public function view(FieldItemListInterface $items, $langcode = NULL);

© 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::view/8.1.x