You are here

public function WebformComputedBase::preview in Webform 8.5

Same name and namespace in other branches
  1. 6.x src/Plugin/WebformElement/WebformComputedBase.php \Drupal\webform\Plugin\WebformElement\WebformComputedBase::preview()

Generate a renderable preview of the element.

Return value

array A renderable preview of the element.

Overrides WebformElementBase::preview

File

src/Plugin/WebformElement/WebformComputedBase.php, line 146

Class

WebformComputedBase
Provides a base class for 'webform_computed' elements.

Namespace

Drupal\webform\Plugin\WebformElement

Code

public function preview() {
  return [
    '#type' => $this
      ->getTypeName(),
    '#title' => $this
      ->getPluginLabel(),
    '#template' => $this
      ->t('This is a @label value.', [
      '@label' => $this
        ->getPluginLabel(),
    ]),
  ];
}