public function WebformTestElement::formatHtml in Webform 8.5
Same name and namespace in other branches
- 6.x tests/modules/webform_test_element/src/Plugin/WebformElement/WebformTestElement.php \Drupal\webform_test_element\Plugin\WebformElement\WebformTestElement::formatHtml()
Format an element's value as HTML.
Parameters
array $element: An element.
\Drupal\webform\WebformSubmissionInterface $webform_submission: A webform submission.
array $options: An array of options.
Return value
array|string The element's value formatted as an HTML string or a render array.
Overrides WebformElementBase::formatHtml
File
- tests/
modules/ webform_test_element/ src/ Plugin/ WebformElement/ WebformTestElement.php, line 38
Class
- WebformTestElement
- Provides a 'webform_test_element' element.
Namespace
Drupal\webform_test_element\Plugin\WebformElementCode
public function formatHtml(array $element, WebformSubmissionInterface $webform_submission, array $options = []) {
$this
->displayMessage(__FUNCTION__);
return '<i>' . $this
->formatText($element, $webform_submission, $options) . '</i>';
}