public function FormatterInterface::viewElements in Drupal 10
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/Field/FormatterInterface.php \Drupal\Core\Field\FormatterInterface::viewElements()
- 9 core/lib/Drupal/Core/Field/FormatterInterface.php \Drupal\Core\Field\FormatterInterface::viewElements()
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.
1 call to FormatterInterface::viewElements()
- FormatterBase::view in core/
lib/ Drupal/ Core/ Field/ FormatterBase.php - Builds a renderable array for a fully themed field.
45 methods override FormatterInterface::viewElements()
- AuthorFormatter::viewElements in core/
modules/ user/ src/ Plugin/ Field/ FieldFormatter/ AuthorFormatter.php - Builds a renderable array for a field value.
- AuthorNameFormatter::viewElements in core/
modules/ comment/ src/ Plugin/ Field/ FieldFormatter/ AuthorNameFormatter.php - Builds a renderable array for a field value.
- BaseFieldFileFormatterBase::viewElements in core/
modules/ file/ src/ Plugin/ Field/ FieldFormatter/ BaseFieldFileFormatterBase.php - Builds a renderable array for a field value.
- BasicStringFormatter::viewElements in core/
lib/ Drupal/ Core/ Field/ Plugin/ Field/ FieldFormatter/ BasicStringFormatter.php - Builds a renderable array for a field value.
- BooleanFormatter::viewElements in core/
lib/ Drupal/ Core/ Field/ Plugin/ Field/ FieldFormatter/ BooleanFormatter.php - Builds a renderable array for a field value.
File
- core/
lib/ Drupal/ Core/ Field/ FormatterInterface.php, line 88
Class
- FormatterInterface
- Interface definition for field formatter plugins.
Namespace
Drupal\Core\FieldCode
public function viewElements(FieldItemListInterface $items, $langcode);