You are here

public function EntityViewController::viewRevision in Drupal 9

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Entity/Controller/EntityViewController.php \Drupal\Core\Entity\Controller\EntityViewController::viewRevision()

Provides a page to render a single entity revision.

Parameters

\Drupal\Core\Entity\EntityInterface $_entity_revision: The Entity to be rendered. Note this variable is named $_entity_revision rather than $entity to prevent collisions with other named placeholders in the route.

string $view_mode: (optional) The view mode that should be used to display the entity. Defaults to 'full'.

Return value

array A render array.

2 string references to 'EntityViewController::viewRevision'
entity_test.routing.yml in core/modules/system/tests/modules/entity_test/entity_test.routing.yml
core/modules/system/tests/modules/entity_test/entity_test.routing.yml
media.routing.yml in core/modules/media/media.routing.yml
core/modules/media/media.routing.yml

File

core/lib/Drupal/Core/Entity/Controller/EntityViewController.php, line 158

Class

EntityViewController
Defines a generic controller to render a single entity.

Namespace

Drupal\Core\Entity\Controller

Code

public function viewRevision(EntityInterface $_entity_revision, $view_mode = 'full') {
  return $this
    ->view($_entity_revision, $view_mode);
}