You are here

public static function YamlFormCodeMirror::preRenderYamlFormCodeMirror in YAML Form 8

Prepares a #type 'yamlform_code' render element for theme_element().

Parameters

array $element: An associative array containing the properties of the element. Properties used: #title, #value, #description, #size, #maxlength, #placeholder, #required, #attributes.

Return value

array The $element with prepared variables ready for theme_element().

1 call to YamlFormCodeMirror::preRenderYamlFormCodeMirror()
YamlFormHtmlEditor::preRenderYamlFormHtmlEditor in src/Element/YamlFormHtmlEditor.php
Prepares a #type 'html_editor' render element for input.html.twig.

File

src/Element/YamlFormCodeMirror.php, line 99

Class

YamlFormCodeMirror
Provides a form element for HTML, YAML, or Plain text using CodeMirror.

Namespace

Drupal\yamlform\Element

Code

public static function preRenderYamlFormCodeMirror($element) {
  static::setAttributes($element, [
    'js-yamlform-codemirror',
    'yamlform-codemirror',
    $element['#mode'],
  ]);
  $element['#attributes']['data-yamlform-codemirror-mode'] = static::getMode($element['#mode']);
  $element['#attached']['library'][] = 'yamlform/yamlform.element.codemirror.' . $element['#mode'];
  return $element;
}