You are here

class EntityEmbedTestTwigController in Entity Embed 8

Controller routines for Twig theme test routes.

Hierarchy

Expanded class hierarchy of EntityEmbedTestTwigController

File

tests/modules/entity_embed_test/src/EntityEmbedTestTwigController.php, line 8

Namespace

Drupal\entity_embed_test
View source
class EntityEmbedTestTwigController {

  /**
   * Menu callback for testing entity_embed twig extension using entity ID.
   */
  public function idRender() {
    return [
      '#theme' => 'entity_embed_twig_test',
      '#entity_type' => 'node',
      '#id' => '1',
    ];
  }

  /**
   * Menu callback.
   *
   * Used for testing entity_embed twig extension using 'label' Entity Embed
   * Display plugin.
   */
  public function labelPluginRender() {
    return [
      '#theme' => 'entity_embed_twig_test',
      '#entity_type' => 'node',
      '#id' => '1',
      '#display_plugin' => 'entity_reference:entity_reference_label',
    ];
  }

  /**
   * Menu callback.
   *
   * Used for testing entity_embed twig extension using 'label' Entity Embed
   * Display plugin without linking to the node.
   */
  public function labelPluginNoLinkRender() {
    return [
      '#theme' => 'entity_embed_twig_test',
      '#entity_type' => 'node',
      '#id' => '1',
      '#display_plugin' => 'entity_reference:entity_reference_label',
      '#display_settings' => [
        'link' => 0,
      ],
    ];
  }

}

Members

Namesort descending Modifiers Type Description Overrides
EntityEmbedTestTwigController::idRender public function Menu callback for testing entity_embed twig extension using entity ID.
EntityEmbedTestTwigController::labelPluginNoLinkRender public function Menu callback.
EntityEmbedTestTwigController::labelPluginRender public function Menu callback.