You are here

public function CKEditor::__construct in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/ckeditor/src/Plugin/Editor/CKEditor.php \Drupal\ckeditor\Plugin\Editor\CKEditor::__construct()

Constructs a \Drupal\ckeditor\Plugin\Editor\CKEditor object.

Parameters

array $configuration: A configuration array containing information about the plugin instance.

string $plugin_id: The plugin_id for the plugin instance.

mixed $plugin_definition: The plugin implementation definition.

\Drupal\ckeditor\CKEditorPluginManager $ckeditor_plugin_manager: The CKEditor plugin manager.

\Drupal\Core\Extension\ModuleHandlerInterface $module_handler: The module handler to invoke hooks on.

\Drupal\Core\Language\LanguageManagerInterface $language_manager: The language manager.

\Drupal\Core\Render\RendererInterface $renderer: The renderer.

\Drupal\Core\State\StateInterface $state: The state key/value store.

\Drupal\Core\File\FileUrlGeneratorInterface $file_url_generator: The file URL generator.

\Drupal\Core\Extension\ModuleExtensionList $module_list: The module list service.

Overrides PluginBase::__construct

File

core/modules/ckeditor/src/Plugin/Editor/CKEditor.php, line 108

Class

CKEditor
Defines a CKEditor-based text editor for Drupal.

Namespace

Drupal\ckeditor\Plugin\Editor

Code

public function __construct(array $configuration, $plugin_id, $plugin_definition, CKEditorPluginManager $ckeditor_plugin_manager, ModuleHandlerInterface $module_handler, LanguageManagerInterface $language_manager, RendererInterface $renderer, StateInterface $state, FileUrlGeneratorInterface $file_url_generator = NULL, ModuleExtensionList $module_list = NULL) {
  parent::__construct($configuration, $plugin_id, $plugin_definition);
  $this->ckeditorPluginManager = $ckeditor_plugin_manager;
  $this->moduleHandler = $module_handler;
  $this->languageManager = $language_manager;
  $this->renderer = $renderer;
  $this->state = $state;
  if (!$file_url_generator) {
    @trigger_error('Calling CKEditor::__construct() without the $file_url_generator argument is deprecated in drupal:9.3.0 and will be required before drupal:10.0.0. See https://www.drupal.org/node/2940031', E_USER_DEPRECATED);
    $file_url_generator = \Drupal::service('file_url_generator');
  }
  $this->fileUrlGenerator = $file_url_generator;
  if (!$module_list) {
    @trigger_error('Calling CKEditor::__construct() without the $module_list argument is deprecated in drupal:9.3.0 and is required in drupal:10.0.0. See https://www.drupal.org/node/2940438', E_USER_DEPRECATED);
    $module_list = \Drupal::service('extension.list.module');
  }
  $this->moduleList = $module_list;
}