You are here

protected function WebformTable::format in Webform 6.x

Same name and namespace in other branches
  1. 8.5 src/Plugin/WebformElement/WebformTable.php \Drupal\webform\Plugin\WebformElement\WebformTable::format()

Format an element's value as HTML or plain text.

Parameters

string $type: The format type, HTML or Text.

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::format

File

src/Plugin/WebformElement/WebformTable.php, line 130

Class

WebformTable
Provides a 'webform_table' element.

Namespace

Drupal\webform\Plugin\WebformElement

Code

protected function format($type, array &$element, WebformSubmissionInterface $webform_submission, array $options = []) {
  $item_function = 'format' . $type . 'Item';
  return $this
    ->{$item_function}($element, $webform_submission, $options);
}