NodeController::revisionShow

public NodeController::revisionShow($node_revision)

Displays a node revision.

Parameters

int $node_revision: The node revision ID.

Return value

array An array suitable for drupal_render().

File

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

Class

NodeController
Returns responses for Node routes.

Namespace

Drupal\node\Controller

Code

public function revisionShow($node_revision) {
  $node = $this->entityManager()->getStorage('node')->loadRevision($node_revision);
  $node = $this->entityManager()->getTranslationFromContext($node);
  $node_view_controller = new NodeViewController($this->entityManager, $this->renderer, $this->currentUser());
  $page = $node_view_controller->view($node);
  unset($page['nodes'][$node->id()]['#cache']);
  return $page;
}
doc_Drupal
2016-10-29 09:30:38
Comments
Leave a Comment

Please login to continue.