EditorBase.php

Same filename and directory in other branches
  1. 9 core/modules/editor/src/Plugin/EditorBase.php
  2. 8.9.x core/modules/editor/src/Plugin/EditorBase.php
  3. 10 core/modules/editor/src/Plugin/EditorBase.php

Namespace

Drupal\editor\Plugin

File

core/modules/editor/src/Plugin/EditorBase.php

View source
<?php

namespace Drupal\editor\Plugin;

use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Plugin\PluginBase;

/**
 * Defines a base class from which other modules providing editors may extend.
 *
 * This class provides default implementations of the EditorPluginInterface so
 * that classes extending this one do not need to implement every method.
 *
 * Plugins extending this class need to specify an annotation containing the
 * plugin definition so the plugin can be discovered.
 *
 * @see \Drupal\editor\Annotation\Editor
 * @see \Drupal\editor\Plugin\EditorPluginInterface
 * @see \Drupal\editor\Plugin\EditorManager
 * @see plugin_api
 */
abstract class EditorBase extends PluginBase implements EditorPluginInterface {
    
    /**
     * {@inheritdoc}
     */
    public function getDefaultSettings() {
        return [];
    }
    
    /**
     * {@inheritdoc}
     */
    public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
        return $form;
    }
    
    /**
     * {@inheritdoc}
     */
    public function validateConfigurationForm(array &$form, FormStateInterface $form_state) {
    }
    
    /**
     * {@inheritdoc}
     */
    public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
    }

}

Classes

Title Deprecated Summary
EditorBase Defines a base class from which other modules providing editors may extend.

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