public function WebformComputedBase::preview in Webform 6.x
Same name and namespace in other branches
- 8.5 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 163
Class
- WebformComputedBase
- Provides a base class for 'webform_computed' elements.
Namespace
Drupal\webform\Plugin\WebformElementCode
public function preview() {
return [
'#type' => $this
->getTypeName(),
'#title' => $this
->getPluginLabel(),
'#template' => $this
->t('This is a @label value.', [
'@label' => $this
->getPluginLabel(),
]),
];
}