You are here

protected function WebformImageSelect::formatTextItem in Webform 8.5

Same name and namespace in other branches
  1. 6.x 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 156

Class

WebformImageSelect
Provides a 'image_select' element.

Namespace

Drupal\webform_image_select\Plugin\WebformElement

Code

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);
}