public EntityViewBuilderInterface::viewField(FieldItemListInterface $items, $display_options = array())
Builds a renderable array for the value of a single field in an entity.
The resulting output is a fully themed field with label and multiple values.
This function can be used by third-party modules that need to output an isolated field.
The function takes care of invoking the prepare_view steps. It also respects field access permissions.
\Drupal\Core\Field\FieldItemListInterface $items: FieldItemList containing the values to be displayed.
string|array $display_options: Can be either:
array A renderable array for the field values.
\Drupal\Core\Entity\EntityViewBuilderInterface::viewFieldItem()
public function viewField(FieldItemListInterface $items, $display_options = array());
© 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!Entity!EntityViewBuilderInterface.php/function/EntityViewBuilderInterface::viewField/8.1.x