function EditorPluginInterface::getJSSettings

Same name in other branches
  1. 9 core/modules/editor/src/Plugin/EditorPluginInterface.php \Drupal\editor\Plugin\EditorPluginInterface::getJSSettings()
  2. 8.9.x core/modules/editor/src/Plugin/EditorPluginInterface.php \Drupal\editor\Plugin\EditorPluginInterface::getJSSettings()
  3. 11.x core/modules/editor/src/Plugin/EditorPluginInterface.php \Drupal\editor\Plugin\EditorPluginInterface::getJSSettings()

Returns JavaScript settings to be attached.

Most text editors use JavaScript to provide a WYSIWYG or toolbar on the client-side interface. This method can be used to convert internal settings of the text editor into JavaScript variables that will be accessible when the text editor is loaded.

Parameters

\Drupal\editor\Entity\Editor $editor: A configured text editor object.

Return value

array An array of settings that will be added to the page for use by this text editor's JavaScript integration.

See also

\Drupal\Core\Render\AttachmentsResponseProcessorInterface::processAttachments()

EditorManager::getAttachments()

3 methods override EditorPluginInterface::getJSSettings()
CKEditor5::getJSSettings in core/modules/ckeditor5/src/Plugin/Editor/CKEditor5.php
Returns JavaScript settings to be attached.
TRexEditor::getJSSettings in core/modules/editor/tests/modules/editor_test/src/Plugin/Editor/TRexEditor.php
Returns JavaScript settings to be attached.
UnicornEditor::getJSSettings in core/modules/editor/tests/modules/editor_test/src/Plugin/Editor/UnicornEditor.php
Returns JavaScript settings to be attached.

File

core/modules/editor/src/Plugin/EditorPluginInterface.php, line 54

Class

EditorPluginInterface
Defines an interface for configurable text editors.

Namespace

Drupal\editor\Plugin

Code

public function getJSSettings(Editor $editor);

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.