class Editor

Same name in this branch
  1. 11.x core/modules/editor/src/Entity/Editor.php \Drupal\editor\Entity\Editor
  2. 11.x core/modules/editor/src/Annotation/Editor.php \Drupal\editor\Annotation\Editor
Same name and namespace in other branches
  1. 9 core/modules/quickedit/src/Plugin/InPlaceEditor/Editor.php \Drupal\quickedit\Plugin\InPlaceEditor\Editor
  2. 9 core/modules/editor/src/Entity/Editor.php \Drupal\editor\Entity\Editor
  3. 9 core/modules/editor/src/Annotation/Editor.php \Drupal\editor\Annotation\Editor
  4. 9 core/modules/editor/src/Plugin/InPlaceEditor/Editor.php \Drupal\editor\Plugin\InPlaceEditor\Editor
  5. 8.9.x core/modules/editor/src/Entity/Editor.php \Drupal\editor\Entity\Editor
  6. 8.9.x core/modules/editor/src/Annotation/Editor.php \Drupal\editor\Annotation\Editor
  7. 8.9.x core/modules/editor/src/Plugin/InPlaceEditor/Editor.php \Drupal\editor\Plugin\InPlaceEditor\Editor
  8. 10 core/modules/editor/src/Entity/Editor.php \Drupal\editor\Entity\Editor
  9. 10 core/modules/editor/src/Annotation/Editor.php \Drupal\editor\Annotation\Editor
  10. 10 core/modules/editor/src/Attribute/Editor.php \Drupal\editor\Attribute\Editor

Defines an Editor attribute object.

Plugin Namespace: Plugin\Editor

For a working example, see \Drupal\ckeditor5\Plugin\Editor\CKEditor5

Attributes

#[\Attribute(\Attribute::TARGET_CLASS)]
#[ConfigEntityType(id: 'editor', label: new TranslatableMarkup('Text editor'), label_collection: new TranslatableMarkup('Text editors'), label_singular: new TranslatableMarkup('text editor'), label_plural: new TranslatableMarkup('text editors'), entity_keys: ['id' => 'format'], handlers: ['access' => EditorAccessControlHandler::class], label_count: ['singular' => '@count text editor', 'plural' => '@count text editors'], constraints: ['RequiredConfigDependencies' => ['filter_format']], config_export: ['format', 'editor', 'settings', 'image_upload'])]

Hierarchy

  • class \Drupal\editor\Attribute\Editor implements \Drupal\Component\Plugin\Attribute\Plugin

Expanded class hierarchy of Editor

See also

\Drupal\editor\Plugin\EditorPluginInterface

\Drupal\editor\Plugin\EditorBase

\Drupal\editor\Plugin\EditorManager

hook_editor_info_alter()

Plugin API

4 files declare their use of Editor
CKEditor5.php in core/modules/ckeditor5/src/Plugin/Editor/CKEditor5.php
EditorManager.php in core/modules/editor/src/Plugin/EditorManager.php
TRexEditor.php in core/modules/editor/tests/modules/editor_test/src/Plugin/Editor/TRexEditor.php
UnicornEditor.php in core/modules/editor/tests/modules/editor_test/src/Plugin/Editor/UnicornEditor.php
48 string references to 'Editor'
AssetAggregationAcrossPagesTest::testFrontAndRecipesPagesEditor in core/profiles/demo_umami/tests/src/FunctionalJavascript/AssetAggregationAcrossPagesTest.php
Checks the front and recipe page asset requests as an editor.
CKEditor5::assessActiveTextEditorAfterBuild in core/modules/ckeditor5/src/Plugin/Editor/CKEditor5.php
Form #after_build callback: provides text editor state changes.
CKEditor5::buildConfigurationForm in core/modules/ckeditor5/src/Plugin/Editor/CKEditor5.php
Form constructor.
CKEditor5::submitConfigurationForm in core/modules/ckeditor5/src/Plugin/Editor/CKEditor5.php
Form submission handler.
CKEditor5::validateConfigurationForm in core/modules/ckeditor5/src/Plugin/Editor/CKEditor5.php
Form validation handler.

... See full list

File

core/modules/editor/src/Attribute/Editor.php, line 21

Namespace

Drupal\editor\Attribute
View source
class Editor extends Plugin {
  
  /**
   * Constructs an Editor object.
   *
   * @param string $id
   *   The plugin ID.
   * @param \Drupal\Core\StringTranslation\TranslatableMarkup $label
   *   The human-readable name of the text editor, translated.
   * @param bool $supports_content_filtering
   *   Whether the editor supports "allowed content only" filtering.
   * @param bool $supports_inline_editing
   *   Whether the editor supports the inline editing provided by the Edit
   *   module.
   * @param bool $is_xss_safe
   *   Whether this text editor is not vulnerable to XSS attacks.
   * @param string[] $supported_element_types
   *   On which form element #types this text editor is capable of working.
   * @param class-string|null $deriver
   *   (optional) The deriver class.
   */
  public function __construct(public readonly string $id, public readonly TranslatableMarkup $label, public readonly bool $supports_content_filtering, public readonly bool $supports_inline_editing, public readonly bool $is_xss_safe, public readonly array $supported_element_types, public readonly ?string $deriver = NULL) {
  }

}

Members

Title Sort descending Modifiers Object type Summary
Editor::__construct public function Constructs an Editor object.

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