You are here

public function EditorPluginInterface::getJSSettings in Drupal 10

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

2 methods override EditorPluginInterface::getJSSettings()
TRexEditor::getJSSettings in core/modules/editor/tests/modules/src/Plugin/Editor/TRexEditor.php
Returns JavaScript settings to be attached.
UnicornEditor::getJSSettings in core/modules/editor/tests/modules/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);