You are here

interface MediaEntityRendererInterface in Gutenberg 8.2

Same name and namespace in other branches
  1. 8 src/MediaEntityRendererInterface.php \Drupal\gutenberg\MediaEntityRendererInterface

Renders media entities.

@package Drupal\gutenberg

Hierarchy

Expanded class hierarchy of MediaEntityRendererInterface

All classes that implement MediaEntityRendererInterface

1 file declares its use of MediaEntityRendererInterface
MediaService.php in src/Service/MediaService.php

File

src/MediaEntityRendererInterface.php, line 10

Namespace

Drupal\gutenberg
View source
interface MediaEntityRendererInterface {

  /**
   * Render media entities.
   *
   * @param \Drupal\media\Entity\Media|string $media_entity
   *   Media entity ID or loaded media entity instance.
   * @param string $view_mode
   *   (optional) View mode of media entity, 'full' is default.
   *
   * @return string
   *   Rendered HTML of the media entity.
   */
  public function render($media_entity, string $view_mode = 'full');

  /**
   * Return the media entity render array.
   *
   * @param \Drupal\media\Entity\Media|string $media_entity
   *   Media entity ID or loaded media entity instance.
   * @param string $view_mode
   *   (optional) View mode of media entity, 'full' is default.
   *
   * @return array
   *   Render array of the media entity.
   */
  public function renderArray($media_entity, string $view_mode = 'full');

}

Members

Namesort descending Modifiers Type Description Overrides
MediaEntityRendererInterface::render public function Render media entities. 1
MediaEntityRendererInterface::renderArray public function Return the media entity render array. 1