You are here

public function EntityViewBuilderInterface::viewFieldItem in Drupal 8

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Entity/EntityViewBuilderInterface.php \Drupal\Core\Entity\EntityViewBuilderInterface::viewFieldItem()

Builds a renderable array for a single field item.

Parameters

\Drupal\Core\Field\FieldItemInterface $item: FieldItem to be displayed.

string|array $display_options: Can be either the name of a view mode, or an array of display settings. See EntityViewBuilderInterface::viewField() for more information.

Return value

array A renderable array for the field item.

See also

\Drupal\Core\Entity\EntityViewBuilderInterface::viewField()

1 method overrides EntityViewBuilderInterface::viewFieldItem()
EntityViewBuilder::viewFieldItem in core/lib/Drupal/Core/Entity/EntityViewBuilder.php
Builds a renderable array for a single field item.

File

core/lib/Drupal/Core/Entity/EntityViewBuilderInterface.php, line 141

Class

EntityViewBuilderInterface
Defines an interface for entity view builders.

Namespace

Drupal\Core\Entity

Code

public function viewFieldItem(FieldItemInterface $item, $display_options = []);