public function OpignoAnswerController::revisionPageTitle in Opigno module 8
Same name and namespace in other branches
- 3.x src/Controller/OpignoAnswerController.php \Drupal\opigno_module\Controller\OpignoAnswerController::revisionPageTitle()
Page title callback for a Answer revision.
Parameters
int $opigno_answer_revision: The Answer revision ID.
Return value
string The page title.
Throws
\Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException
\Drupal\Component\Plugin\Exception\PluginNotFoundException
File
- src/
Controller/ OpignoAnswerController.php, line 52
Class
- OpignoAnswerController
- Class OpignoAnswerController.
Namespace
Drupal\opigno_module\ControllerCode
public function revisionPageTitle($opigno_answer_revision) {
$date_formatter = \Drupal::service('date.formatter');
$opigno_answer = $this
->entityTypeManager()
->getStorage('opigno_answer')
->loadRevision($opigno_answer_revision);
return $this
->t('Revision of %title from %date', [
'%title' => $opigno_answer
->label(),
'%date' => $date_formatter
->format($opigno_answer
->getRevisionCreationTime()),
]);
}