You are here

public function NodeController::revisionPageTitle in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/node/src/Controller/NodeController.php \Drupal\node\Controller\NodeController::revisionPageTitle()
  2. 10 core/modules/node/src/Controller/NodeController.php \Drupal\node\Controller\NodeController::revisionPageTitle()

Page title callback for a node revision.

Parameters

int $node_revision: The node revision ID.

Return value

string The page title.

1 string reference to 'NodeController::revisionPageTitle'
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 167

Class

NodeController
Returns responses for Node routes.

Namespace

Drupal\node\Controller

Code

public function revisionPageTitle($node_revision) {
  $node = $this
    ->entityTypeManager()
    ->getStorage('node')
    ->loadRevision($node_revision);
  return $this
    ->t('Revision of %title from %date', [
    '%title' => $node
      ->label(),
    '%date' => $this->dateFormatter
      ->format($node
      ->getRevisionCreationTime()),
  ]);
}