You are here

public function ThemePluginBase::build in Display Suite 8.4

Same name and namespace in other branches
  1. 8.2 src/Plugin/DsField/ThemePluginBase.php \Drupal\ds\Plugin\DsField\ThemePluginBase::build()
  2. 8.3 src/Plugin/DsField/ThemePluginBase.php \Drupal\ds\Plugin\DsField\ThemePluginBase::build()

Renders a field.

Return value

array A renderable array representing the content of the field.

Overrides DsFieldBase::build

File

src/Plugin/DsField/ThemePluginBase.php, line 13

Class

ThemePluginBase
The base plugin to create DS theme fields.

Namespace

Drupal\ds\Plugin\DsField

Code

public function build() {
  $field = $this
    ->getConfiguration();
  $format = $this
    ->formatter();
  return [
    '#markup' => _theme($format, $field),
  ];
}