public function DummyImageFormatter::viewElements in Drupal 10
Same name and namespace in other branches
- 8 core/modules/image/tests/modules/image_module_test/src/Plugin/Field/FieldFormatter/DummyImageFormatter.php \Drupal\image_module_test\Plugin\Field\FieldFormatter\DummyImageFormatter::viewElements()
- 9 core/modules/image/tests/modules/image_module_test/src/Plugin/Field/FieldFormatter/DummyImageFormatter.php \Drupal\image_module_test\Plugin\Field\FieldFormatter\DummyImageFormatter::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.
Overrides FormatterInterface::viewElements
File
- core/
modules/ image/ tests/ modules/ image_module_test/ src/ Plugin/ Field/ FieldFormatter/ DummyImageFormatter.php, line 24
Class
- DummyImageFormatter
- Plugin implementation of the Dummy image formatter.
Namespace
Drupal\image_module_test\Plugin\Field\FieldFormatterCode
public function viewElements(FieldItemListInterface $items, $langcode) {
return [
[
'#markup' => 'Dummy',
],
];
}