You are here

public static function YamlFormCodeMirror::getMode in YAML Form 8

Get the CodeMirror mode for specified type.

Parameters

string $mode: Mode (text, html, or yaml).

Return value

string The CodeMirror mode (aka mime type).

2 calls to YamlFormCodeMirror::getMode()
template_preprocess_yamlform_codemirror in includes/yamlform.theme.inc
Prepares variables for form CodeMirror template.
YamlFormCodeMirror::preRenderYamlFormCodeMirror in src/Element/YamlFormCodeMirror.php
Prepares a #type 'yamlform_code' render element for theme_element().

File

src/Element/YamlFormCodeMirror.php, line 191

Class

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

Namespace

Drupal\yamlform\Element

Code

public static function getMode($mode) {
  return isset(static::$modes[$mode]) ? static::$modes[$mode] : static::$modes['text'];
}