You are here

public function EditorManager::listOptions in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/editor/src/Plugin/EditorManager.php \Drupal\editor\Plugin\EditorManager::listOptions()
  2. 9 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;
}