You are here

public function WebformCompositeBase::formatText in Webform 6.x

Same name and namespace in other branches
  1. 8.5 src/Plugin/WebformElement/WebformCompositeBase.php \Drupal\webform\Plugin\WebformElement\WebformCompositeBase::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

File

src/Plugin/WebformElement/WebformCompositeBase.php, line 351

Class

WebformCompositeBase
Provides a base for composite elements.

Namespace

Drupal\webform\Plugin\WebformElement

Code

public function formatText(array $element, WebformSubmissionInterface $webform_submission, array $options = []) {
  if (isset($options['composite_key'])) {
    return $this
      ->formatCompositeText($element, $webform_submission, $options);
  }
  else {
    return parent::formatText($element, $webform_submission, $options);
  }
}