You are here

public static function WebformCodeMirror::getMode in Webform 6.x

Same name and namespace in other branches
  1. 8.5 src/Element/WebformCodeMirror.php \Drupal\webform\Element\WebformCodeMirror::getMode()

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 WebformCodeMirror::getMode()
template_preprocess_webform_codemirror in includes/webform.theme.template.inc
Prepares variables for webform CodeMirror templates.
WebformCodeMirror::preRenderWebformCodeMirror in src/Element/WebformCodeMirror.php
Prepares a #type 'webform_code' render element for theme_element().

File

src/Element/WebformCodeMirror.php, line 232

Class

WebformCodeMirror
Provides a webform element for using CodeMirror.

Namespace

Drupal\webform\Element

Code

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