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
1 2 3 4 5 6 7 8 | 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 ; } |
Please login to continue.