You are here

public function WebformElementBase::formatHtml in Webform 8.5

Same name and namespace in other branches
  1. 6.x src/Plugin/WebformElementBase.php \Drupal\webform\Plugin\WebformElementBase::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 WebformElementInterface::formatHtml

8 calls to WebformElementBase::formatHtml()
Table::formatTextItem in src/Plugin/WebformElement/Table.php
Format an element's value as text.
TextFormat::buildExportRecord in src/Plugin/WebformElement/TextFormat.php
Build an element's export row.
TextFormat::formatTextItem in src/Plugin/WebformElement/TextFormat.php
Format an element's value as text.
WebformCompositeBase::formatHtml in src/Plugin/WebformElement/WebformCompositeBase.php
Format an element's value as HTML.
WebformComputedBase::formatTableColumn in src/Plugin/WebformElement/WebformComputedBase.php
Format an element's table column value.

... See full list

2 methods override WebformElementBase::formatHtml()
WebformCompositeBase::formatHtml in src/Plugin/WebformElement/WebformCompositeBase.php
Format an element's value as HTML.
WebformTestElement::formatHtml in tests/modules/webform_test_element/src/Plugin/WebformElement/WebformTestElement.php
Format an element's value as HTML.

File

src/Plugin/WebformElementBase.php, line 1376

Class

WebformElementBase
Provides a base class for a webform element.

Namespace

Drupal\webform\Plugin

Code

public function formatHtml(array $element, WebformSubmissionInterface $webform_submission, array $options = []) {
  return $this
    ->format('Html', $element, $webform_submission, $options);
}