function EditorManager::listOptions

Same name in other branches
  1. 9 core/modules/editor/src/Plugin/EditorManager.php \Drupal\editor\Plugin\EditorManager::listOptions()
  2. 8.9.x core/modules/editor/src/Plugin/EditorManager.php \Drupal\editor\Plugin\EditorManager::listOptions()
  3. 10 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 43

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.