function EntityViewBuilderInterface::viewFieldItem
Same name in other branches
- 9 core/lib/Drupal/Core/Entity/EntityViewBuilderInterface.php \Drupal\Core\Entity\EntityViewBuilderInterface::viewFieldItem()
- 10 core/lib/Drupal/Core/Entity/EntityViewBuilderInterface.php \Drupal\Core\Entity\EntityViewBuilderInterface::viewFieldItem()
- 11.x 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\EntityCode
public function viewFieldItem(FieldItemInterface $item, $display_options = []);
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.