webform-codemirror.html.twig in Webform 8.5
Same filename and directory in other branches
Theme implementation for 'CodeMirror' code.
Available variables
- code: The code.
- type: The type of code.
- mode: The CodeMirror mode used to format the code.
See also
http://codemirror.net/doc/manual.html#option_mode
\Drupal\webform\Element\WebformCodeMirror()
9 theme calls to webform-codemirror.html.twig
- OverrideWebformVariant::buildConfigurationForm in src/
Plugin/ WebformVariant/ OverrideWebformVariant.php - Form constructor.
- OverrideWebformVariant::debug in src/
Plugin/ WebformVariant/ OverrideWebformVariant.php - Display debugging information.
- WebformBlock::blockForm in src/
Plugin/ Block/ WebformBlock.php - WebformCodeMirror::formatHtmlItem in src/
Plugin/ WebformElement/ WebformCodeMirror.php - Format an element's value as HTML.
- WebformEntityReferenceWidgetTrait::formElement in src/
Plugin/ Field/ FieldWidget/ WebformEntityReferenceWidgetTrait.php
File
templates/webform-codemirror.html.twigView source
- {#
- /**
- * @file
- * Theme implementation for 'CodeMirror' code.
- *
- * Available variables
- * - code: The code.
- * - type: The type of code.
- * - mode: The CodeMirror mode used to format the code.
- *
- * @see http://codemirror.net/doc/manual.html#option_mode
- * @see \Drupal\webform\Element\WebformCodeMirror()
- * @see template_preprocess_webform_codemirror()
- *
- * @ingroup themeable
- */
- #}
- {% if type == 'html' %}
- {{ attach_library('webform/webform.element.codemirror.html') }}
- {% elseif type == 'yaml' %}
- {{ attach_library('webform/webform.element.codemirror.yaml') }}
- {% else %}
- {{ attach_library('webform/webform.element.codemirror.text') }}
- {% endif %}
- <pre class="js-webform-codemirror-runmode webform-codemirror-runmode" data-webform-codemirror-mode="{{ mode }}">{{ code }}</pre>