protected function WebformImageSelect::formatTextItem in Webform 6.x
Same name and namespace in other branches
- 8.5 modules/webform_image_select/src/Plugin/WebformElement/WebformImageSelect.php \Drupal\webform_image_select\Plugin\WebformElement\WebformImageSelect::formatTextItem()
Format an element's value as text.
Parameters
array $element: An element.
\Drupal\webform\WebformSubmissionInterface $webform_submission: A webform submission.
array $options: An array of options.
Return value
string The element's value formatted as text.
Overrides OptionsBase::formatTextItem
See also
_webform_token_get_submission_value()
File
- modules/
webform_image_select/ src/ Plugin/ WebformElement/ WebformImageSelect.php, line 181
Class
- WebformImageSelect
- Provides a 'image_select' element.
Namespace
Drupal\webform_image_select\Plugin\WebformElementCode
protected function formatTextItem(array $element, WebformSubmissionInterface $webform_submission, array $options = []) {
if ($this
->getItemFormat($element) === 'image') {
$element['#format'] = 'value';
}
return parent::formatTextItem($element, $webform_submission, $options);
}