You are here

public function TextFormat::prepare in YAML Form 8

Prepare an element to be rendered within a form.

Parameters

array $element: An element.

\Drupal\yamlform\YamlFormSubmissionInterface $yamlform_submission: A form submission.

Overrides YamlFormElementBase::prepare

File

src/Plugin/YamlFormElement/TextFormat.php, line 46

Class

TextFormat
Provides a 'text_format' element.

Namespace

Drupal\yamlform\Plugin\YamlFormElement

Code

public function prepare(array &$element, YamlFormSubmissionInterface $yamlform_submission) {
  parent::prepare($element, $yamlform_submission);
  $element['#after_build'] = [
    [
      get_class($this),
      'afterBuild',
    ],
  ];
  $element['#attached']['library'][] = 'yamlform/yamlform.element.text_format';
}