mergeDefinitionValues example

protected static function getPluginConfiguration(EditorInterface $editor, string $plugin_id): array {
    if ($editor->getEditor() !== 'ckeditor5') {
      throw new \InvalidArgumentException('This method should only be called on text editor config entities using CKEditor 5.');
    }
    return $editor->getSettings()['plugins'][$plugin_id] ?? [];
  }

  /** * {@inheritdoc} */
  public function getToolbarItems(): array {
    return $this->mergeDefinitionValues('getToolbarItems', $this->getDefinitions());
  }

  /** * {@inheritdoc} */
  public function getAdminLibraries(): array {
    $list = $this->mergeDefinitionValues('getAdminLibrary', $this->getDefinitions());
    // Include main admin library.     array_unshift($list, 'ckeditor5/internal.admin');
    return $list;
  }

  
Home | Imprint | This part of the site doesn't use cookies.