You are here

public function ExampleArticle::view in Extra Field 8

Same name and namespace in other branches
  1. 8.2 modules/extra_field_example/src/Plugin/ExtraField/Display/ExampleArticle.php \Drupal\extra_field_example\Plugin\ExtraField\Display\ExampleArticle::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

modules/extra_field_example/src/Plugin/ExtraField/Display/ExampleArticle.php, line 24

Class

ExampleArticle
Example Extra field Display.

Namespace

Drupal\extra_field_example\Plugin\ExtraField\Display

Code

public function view(ContentEntityInterface $entity) {
  $elements = [
    '#markup' => 'This is output from ExampleArticle',
  ];
  return $elements;
}