You are here

public function UserController::revisionPageTitle in User Revision 8

Page title callback for a user revision.

Parameters

int $user_revision: The user revision ID.

Return value

string The page title.

\Drupal\Core\StringTranslation\TranslatableMarkup

Throws

\Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException

\Drupal\Component\Plugin\Exception\PluginNotFoundException

1 string reference to 'UserController::revisionPageTitle'
user_revision.routing.yml in ./user_revision.routing.yml
user_revision.routing.yml

File

src/Controller/UserController.php, line 210

Class

UserController
Returns responses for User revision routes.

Namespace

Drupal\user_revision\Controller

Code

public function revisionPageTitle($user_revision) {
  $user = $this->entityTypeManager
    ->getStorage('user')
    ->loadRevision($user_revision);
  return $this
    ->t('Revision of %title from %date', array(
    '%title' => $user
      ->label(),
    '%date' => $this->dateFormatter
      ->format($user
      ->get('revision_timestamp')->value),
  ));
}