public function OneNodeTypeTest::view in Extra Field 8
Same name and namespace in other branches
- 8.2 tests/extra_field_test/src/Plugin/ExtraField/Display/OneNodeTypeTest.php \Drupal\extra_field_test\Plugin\ExtraField\Display\OneNodeTypeTest::view()
Builds a renderable array for the field.
Parameters
\Drupal\Core\Entity\ContentEntityInterface $entity: The field's host entity.
Return value
array Renderable array.
Overrides ExtraFieldDisplayInterface::view
File
- tests/
extra_field_test/ src/ Plugin/ ExtraField/ Display/ OneNodeTypeTest.php, line 24
Class
- OneNodeTypeTest
- Extra field Display for one node type.
Namespace
Drupal\extra_field_test\Plugin\ExtraField\DisplayCode
public function view(ContentEntityInterface $entity) {
$elements = [
'#markup' => 'Output from OneNodeTypeTest',
];
return $elements;
}