public function WebformMessage::preview in Webform 8.5
Same name and namespace in other branches
- 6.x src/Plugin/WebformElement/WebformMessage.php \Drupal\webform\Plugin\WebformElement\WebformMessage::preview()
Generate a renderable preview of the element.
Return value
array A renderable preview of the element.
Overrides WebformElementBase::preview
File
- src/
Plugin/ WebformElement/ WebformMessage.php, line 77
Class
- WebformMessage
- Provides a 'webform_message' element.
Namespace
Drupal\webform\Plugin\WebformElementCode
public function preview() {
return parent::preview() + [
'#message_type' => 'warning',
'#message_message' => $this
->t('This is a <strong>warning</strong> message.'),
];
}