Editor
class Editor extends Plugin (View source)
Defines an Editor annotation object.
Plugin Namespace: Plugin\Editor
Text editor plugin implementations need to define a plugin definition array through annotation. These definition arrays may be altered through hook_editor_info_alter(). The definition includes the following keys:
- id: The unique, system-wide identifier of the text editor. Typically named the same as the editor library.
- label: The human-readable name of the text editor, translated.
- supports_content_filtering: Whether the editor supports "allowed content only" filtering.
- supports_inline_editing: Whether the editor supports the inline editing provided by the Edit module.
- is_xss_safe: Whether this text editor is not vulnerable to XSS attacks.
- supported_element_types: On which form element #types this text editor is capable of working.
A complete sample plugin definition should be defined as in this example:
Properties
| protected array | $definition | The plugin definition read from the class annotation. |
from Plugin |
| string | $id | The plugin ID. |
|
| Translation | $label | The human-readable name of the editor plugin. |
|
| bool | $supports_content_filtering | Whether the editor supports "allowed content only" filtering. |
|
| bool | $supports_inline_editing | Whether the editor supports the inline editing provided by the Edit module. |
|
| bool | $is_xss_safe | Whether this text editor is not vulnerable to XSS attacks. |
|
| string[] | $supported_element_types | A list of element types this text editor supports. |
Methods
Details
in
Plugin at line 35
__construct($values)
Constructs a Plugin object.
Builds up the plugin definition and invokes the get() method for any classed annotations that were used.
in
Plugin at line 54
protected array
parse(array $values)
Parses an annotation into its definition.
in
Plugin at line 73
get()
Gets the value of an annotation.
in
Plugin at line 80
string
getProvider()
Gets the name of the provider of the annotated class.
in
Plugin at line 87
setProvider(string $provider)
Sets the name of the provider of the annotated class.
in
Plugin at line 94
string
getId()
Gets the unique ID for this annotated class.
string
getClass()
Gets the class of the annotated class.
setClass(string $class)
Sets the class of the annotated class.