You are here

public function YamlFormTest::formatHtml in YAML Form 8

Format an element's value as HTML.

Parameters

array $element: An element.

array|mixed $value: A value.

array $options: An array of options.

Return value

array|string The element's value formatted as an HTML string or a render array.

Overrides YamlFormElementBase::formatHtml

File

tests/modules/yamlform_test/src/Plugin/YamlFormElement/YamlFormTest.php, line 38

Class

YamlFormTest
Provides a 'yamlform_test' element.

Namespace

Drupal\yamlform_test\Plugin\YamlFormElement

Code

public function formatHtml(array &$element, $value, array $options = []) {
  $this
    ->displayMessage(__FUNCTION__);
  return '<i>' . $this
    ->formatText($element, $value, $options) . '</i>';
}