function EntityViewController::viewRevision

Same name in other branches
  1. 9 core/lib/Drupal/Core/Entity/Controller/EntityViewController.php \Drupal\Core\Entity\Controller\EntityViewController::viewRevision()
  2. 8.9.x 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.

Deprecated

in drupal:10.1.0 and is removed from drupal:11.0.0. Use \Drupal\Core\Entity\Controller\EntityRevisionViewController instead.

See also

https://www.drupal.org/node/3314346

File

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

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') {
    @trigger_error(__METHOD__ . ' is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Use \\Drupal\\Core\\Entity\\Controller\\EntityRevisionViewController instead. See https://www.drupal.org/node/3314346', E_USER_DEPRECATED);
    return $this->view($_entity_revision, $view_mode);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.