function NodeController::revisionShow

Same name in other branches
  1. 9 core/modules/node/src/Controller/NodeController.php \Drupal\node\Controller\NodeController::revisionShow()
  2. 8.9.x core/modules/node/src/Controller/NodeController.php \Drupal\node\Controller\NodeController::revisionShow()
  3. 11.x core/modules/node/src/Controller/NodeController.php \Drupal\node\Controller\NodeController::revisionShow()

Displays a node revision.

Parameters

\Drupal\node\NodeInterface $node_revision: The node revision.

Return value

array An array suitable for \Drupal\Core\Render\RendererInterface::render().

1 string reference to 'NodeController::revisionShow'
node.routing.yml in core/modules/node/node.routing.yml
core/modules/node/node.routing.yml

File

core/modules/node/src/Controller/NodeController.php, line 112

Class

NodeController
Returns responses for Node routes.

Namespace

Drupal\node\Controller

Code

public function revisionShow(NodeInterface $node_revision) {
    $node_view_controller = new NodeViewController($this->entityTypeManager(), $this->renderer, $this->currentUser(), $this->entityRepository);
    $page = $node_view_controller->view($node_revision);
    unset($page['nodes'][$node_revision->id()]['#cache']);
    return $page;
}

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