function EditorManager::listOptions

Same name in other branches
  1. 8.9.x core/modules/editor/src/Plugin/EditorManager.php \Drupal\editor\Plugin\EditorManager::listOptions()
  2. 10 core/modules/editor/src/Plugin/EditorManager.php \Drupal\editor\Plugin\EditorManager::listOptions()
  3. 11.x core/modules/editor/src/Plugin/EditorManager.php \Drupal\editor\Plugin\EditorManager::listOptions()

Populates a key-value pair of available text editors.

Return value

array An array of translated text editor labels, keyed by ID.

File

core/modules/editor/src/Plugin/EditorManager.php, line 42

Class

EditorManager
Configurable text editor manager.

Namespace

Drupal\editor\Plugin

Code

public function listOptions() {
    $options = [];
    foreach ($this->getDefinitions() as $key => $definition) {
        $options[$key] = $definition['label'];
    }
    return $options;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.