Defines a base class from which other modules providing editors may extend.
This class provides default implementations of the EditPluginInterface so that classes extending this one do not need to implement every method.
Plugins extending this class 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:
A complete sample plugin definition should be defined as in this example:
@Editor(
id = "myeditor",
label = @Translation("My Editor")
)
Expanded class hierarchy of EditorBase
abstract class EditorBase extends PluginBase implements EditorPluginInterface {
/**
* Implements \Drupal\editor\Plugin\EditPluginInterface::getDefaultSettings().
*/
public function getDefaultSettings() {
return array();
}
/**
* Implements \Drupal\editor\Plugin\EditPluginInterface::settingsForm().
*/
public function settingsForm(array $form, array &$form_state, Editor $editor) {
return $form;
}
/**
* Implements \Drupal\editor\Plugin\EditPluginInterface::settingsFormValidate().
*/
public function settingsFormValidate(array $form, array &$form_state) {
}
/**
* Implements \Drupal\editor\Plugin\EditPluginInterface::settingsFormSubmit().
*/
public function settingsFormSubmit(array $form, array &$form_state) {
}
}
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
EditorBase:: |
public | function |
Implements \Drupal\editor\Plugin\EditPluginInterface::getDefaultSettings(). Overrides EditorPluginInterface:: |
2 |
EditorBase:: |
public | function |
Implements \Drupal\editor\Plugin\EditPluginInterface::settingsForm(). Overrides EditorPluginInterface:: |
2 |
EditorBase:: |
public | function |
Implements \Drupal\editor\Plugin\EditPluginInterface::settingsFormSubmit(). Overrides EditorPluginInterface:: |
1 |
EditorBase:: |
public | function |
Implements \Drupal\editor\Plugin\EditPluginInterface::settingsFormValidate(). Overrides EditorPluginInterface:: |
|
EditorPluginInterface:: |
function | Returns JavaScript settings to be attached. | 2 | |
EditorPluginInterface:: |
function | Returns libraries to be attached. | 2 | |
PluginBase:: |
protected | property | Configuration information passed into the plugin. | 1 |
PluginBase:: |
protected | property | The plugin implementation definition. | |
PluginBase:: |
protected | property | The plugin_id. | |
PluginBase:: |
public | function |
Returns the definition of the plugin implementation. Overrides PluginInspectionInterface:: |
|
PluginBase:: |
public | function |
Returns the plugin_id of the plugin instance. Overrides PluginInspectionInterface:: |
|
PluginBase:: |
public | function | Constructs a Drupal\Component\Plugin\PluginBase object. | 17 |