You are here

public function YamlFormCodeMirror::getFormats in YAML Form 8

Get an element's available formats.

Return value

array An associative array of formats containing name/label pairs.

Overrides YamlFormElementBase::getFormats

File

src/Plugin/YamlFormElement/YamlFormCodeMirror.php, line 63

Class

YamlFormCodeMirror
Provides a 'yamlform_codemirror' element.

Namespace

Drupal\yamlform\Plugin\YamlFormElement

Code

public function getFormats() {
  return parent::getFormats() + [
    'code' => $this
      ->t('Code'),
  ];
}