You are here

public static function YamlFormHtmlEditor::validateYamlFormHtmlEditor in YAML Form 8

Form element validation handler for #type 'yamlform_html_editor'.

File

src/Element/YamlFormHtmlEditor.php, line 53

Class

YamlFormHtmlEditor
Provides a form element for entering HTML using CKEditor or CodeMirror.

Namespace

Drupal\yamlform\Element

Code

public static function validateYamlFormHtmlEditor(&$element, FormStateInterface $form_state, &$complete_form) {
  $value = $element['#value'];
  $form_state
    ->setValueForElement($element, trim($value));
}