interface EditorSelectorInterface

Interface for selecting an in-place editor (an Editor plugin) for a field.

Hierarchy

Expanded class hierarchy of EditorSelectorInterface

All classes that implement EditorSelectorInterface

File

drupal/core/modules/edit/lib/Drupal/edit/EditorSelectorInterface.php, line 15
Contains \Drupal\edit\EditorSelectorInterface.

Namespace

Drupal\edit
View source
interface EditorSelectorInterface {

  /**
   * Returns the in-place editor (an Editor plugin) to use for a field.
   *
   * @param string $formatter_type
   *   The field's formatter type name.
   * @param \Drupal\field\Plugin\Core\Entity\FieldInstance $instance
   *   The field's instance info.
   * @param array $items
   *   The field's item values.
   *
   * @return string|NULL
   *   The editor to use, or NULL to not enable in-place editing.
   */
  public function getEditor($formatter_type, FieldInstance $instance, array $items);

  /**
   * Returns the attachments for all editors.
   *
   * @param array $editor_ids
   *   A list of all in-place editor IDs that should be attached.
   *
   * @return array
   *   An array of attachments, for use with #attached.
   *
   * @see drupal_process_attached()
   */
  public function getEditorAttachments(array $editor_ids);

}

Members

Namesort descending Modifiers Type Description Overrides
EditorSelectorInterface::getEditor public function Returns the in-place editor (an Editor plugin) to use for a field. 1
EditorSelectorInterface::getEditorAttachments public function Returns the attachments for all editors. 1