public function WebformTestElement::formatText in Webform 6.x
Same name and namespace in other branches
- 8.5 tests/modules/webform_test_element/src/Plugin/WebformElement/WebformTestElement.php \Drupal\webform_test_element\Plugin\WebformElement\WebformTestElement::formatText()
Format an element's value as plain text.
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 plain text or a render array.
Overrides WebformElementBase::formatText
1 call to WebformTestElement::formatText()
- WebformTestElement::formatHtml in tests/
modules/ webform_test_element/ src/ Plugin/ WebformElement/ WebformTestElement.php - Format an element's value as HTML.
File
- tests/
modules/ webform_test_element/ src/ Plugin/ WebformElement/ WebformTestElement.php, line 46
Class
- WebformTestElement
- Provides a 'webform_test_element' element.
Namespace
Drupal\webform_test_element\Plugin\WebformElementCode
public function formatText(array $element, WebformSubmissionInterface $webform_submission, array $options = []) {
$value = $this
->getValue($element, $webform_submission, $options);
$this
->displayMessage(__FUNCTION__);
return strtoupper($value);
}