public function MultipleItemsFieldTest::viewElements in Extra Field 8.2
Same name and namespace in other branches
- 8 tests/extra_field_test/src/Plugin/ExtraField/Display/MultipleItemsFieldTest.php \Drupal\extra_field_test\Plugin\ExtraField\Display\MultipleItemsFieldTest::viewElements()
Returns the renderable array of the field item(s).
Parameters
\Drupal\Core\Entity\ContentEntityInterface $entity: The field's host entity.
Return value
array A renderable array of field elements. If this contains children, the field output will be rendered as a multiple value field with each child as a field item.
Overrides ExtraFieldDisplayFormattedInterface::viewElements
File
- tests/
extra_field_test/ src/ Plugin/ ExtraField/ Display/ MultipleItemsFieldTest.php, line 26
Class
- MultipleItemsFieldTest
- Extra field Display for a field with multiple items output.
Namespace
Drupal\extra_field_test\Plugin\ExtraField\DisplayCode
public function viewElements(ContentEntityInterface $entity) {
return [
[
'#markup' => 'Aap',
],
[
'#markup' => 'Noot',
],
[
'#markup' => 'Mies',
],
[
'#markup' => 'Wim',
],
[
'#markup' => 'Zus',
],
[
'#markup' => 'Jet',
],
];
}