function CKEditor5::__construct
Constructs a CKEditor 5 editor plugin.
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\ckeditor5\Plugin\CKEditor5PluginManagerInterface $ckeditor5_plugin_manager: The CKEditor 5 plugin manager.
\Drupal\Core\Language\LanguageManagerInterface $language_manager: The language manager.
\Drupal\Core\Extension\ModuleHandlerInterface $module_handler: The module handler.
\Drupal\ckeditor5\SmartDefaultSettings $smart_default_settings: The smart default settings utility.
\Drupal\Core\Cache\CacheBackendInterface $cache: The cache.
\Psr\Log\LoggerInterface $logger: A logger instance.
\Drupal\ckeditor5\LanguageMapper $languageMapper: The ckeditor language mapper.
Overrides PluginBase::__construct
File
-
core/
modules/ ckeditor5/ src/ Plugin/ Editor/ CKEditor5.php, line 140
Class
- CKEditor5
- Defines a CKEditor 5-based text editor for Drupal.
Namespace
Drupal\ckeditor5\Plugin\EditorCode
public function __construct(array $configuration, $plugin_id, $plugin_definition, CKEditor5PluginManagerInterface $ckeditor5_plugin_manager, LanguageManagerInterface $language_manager, ModuleHandlerInterface $module_handler, SmartDefaultSettings $smart_default_settings, CacheBackendInterface $cache, LoggerInterface $logger, LanguageMapper $languageMapper) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->ckeditor5PluginManager = $ckeditor5_plugin_manager;
$this->languageManager = $language_manager;
$this->moduleHandler = $module_handler;
$this->smartDefaultSettings = $smart_default_settings;
$this->cache = $cache;
$this->logger = $logger;
if (!$languageMapper) {
@trigger_error('Calling ' . __METHOD__ . ' without the $languageMapper argument is deprecated in drupal:11.3.0 and it will be required in drupal:12.0.0. See https://www.drupal.org/node/3551652', E_USER_DEPRECATED);
$languageMapper = \Drupal::service(LanguageMapper::class);
}
$this->languageMapper = $languageMapper;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.