You are here

interface EditorSelectorInterface in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/quickedit/src/EditorSelectorInterface.php \Drupal\quickedit\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

core/modules/quickedit/src/EditorSelectorInterface.php, line 10

Namespace

Drupal\quickedit
View source
interface EditorSelectorInterface {

  /**
   * Returns the in-place editor (an InPlaceEditor plugin) to use for a field.
   *
   * @param string $formatter_type
   *   The field's formatter type name.
   * @param \Drupal\Core\Field\FieldItemListInterface $items
   *   The field values to be in-place edited.
   *
   * @return string|null
   *   The editor to use, or NULL to not enable in-place editing.
   */
  public function getEditor($formatter_type, FieldItemListInterface $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\Core\Render\AttachmentsResponseProcessorInterface::processAttachments()
   */
  public function getEditorAttachments(array $editor_ids);

}

Members

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