You are here

public function TestField::build in Display Suite 8.4

Same name and namespace in other branches
  1. 8.2 tests/modules/ds_test/src/Plugin/DsField/TestField.php \Drupal\ds_test\Plugin\DsField\TestField::build()
  2. 8.3 tests/modules/ds_test/src/Plugin/DsField/TestField.php \Drupal\ds_test\Plugin\DsField\TestField::build()

Renders a field.

Return value

array A renderable array representing the content of the field.

Overrides DsFieldBase::build

File

tests/modules/ds_test/src/Plugin/DsField/TestField.php, line 21

Class

TestField
Test field plugin.

Namespace

Drupal\ds_test\Plugin\DsField

Code

public function build() {
  return [
    '#markup' => 'Test field plugin on node ' . $this
      ->entity()
      ->id(),
  ];
}