You are here

public function WebformCompositeBase::formatHtml in Webform 6.x

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

1 call to WebformCompositeBase::formatHtml()
WebformCompositeBase::formatTableColumn in src/Plugin/WebformElement/WebformCompositeBase.php
Format an element's table column value.

File

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

Class

WebformCompositeBase
Provides a base for composite elements.

Namespace

Drupal\webform\Plugin\WebformElement

Code

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