You are here

interface PreviewFallbackInterface in Drupal 10

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Render/PreviewFallbackInterface.php \Drupal\Core\Render\PreviewFallbackInterface
  2. 9 core/lib/Drupal/Core/Render/PreviewFallbackInterface.php \Drupal\Core\Render\PreviewFallbackInterface

Allows an element to provide a fallback representation of itself for preview.

Hierarchy

Expanded class hierarchy of PreviewFallbackInterface

All classes that implement PreviewFallbackInterface

4 files declare their use of PreviewFallbackInterface
BlockBase.php in core/lib/Drupal/Core/Block/BlockBase.php
BlockComponentRenderArray.php in core/modules/layout_builder/src/EventSubscriber/BlockComponentRenderArray.php
BlockComponentRenderArrayTest.php in core/modules/layout_builder/tests/src/Unit/BlockComponentRenderArrayTest.php
SectionRenderTest.php in core/modules/layout_builder/tests/src/Unit/SectionRenderTest.php

File

core/lib/Drupal/Core/Render/PreviewFallbackInterface.php, line 8

Namespace

Drupal\Core\Render
View source
interface PreviewFallbackInterface {

  /**
   * Returns a string to be used as a fallback during preview.
   *
   * This is typically used when an element has no output and must be displayed,
   * for example during configuration.
   *
   * @return string|\Drupal\Core\StringTranslation\TranslatableMarkup
   *   A string representing for this.
   */
  public function getPreviewFallbackString();

}

Members