You are here

public function WebformSubmissionViewController::title in Webform 6.x

Same name and namespace in other branches
  1. 8.5 src/Controller/WebformSubmissionViewController.php \Drupal\webform\Controller\WebformSubmissionViewController::title()

The _title_callback for the page that renders a single webform submission.

Parameters

\Drupal\Core\Entity\EntityInterface $webform_submission: The current webform submission.

bool $duplicate: Flag indicating if submission is being duplicated.

Return value

string The page title.

3 string references to 'WebformSubmissionViewController::title'
webform.routing.yml in ./webform.routing.yml
webform.routing.yml
webform_node.routing.yml in modules/webform_node/webform_node.routing.yml
modules/webform_node/webform_node.routing.yml
webform_submission_log.routing.yml in modules/webform_submission_log/webform_submission_log.routing.yml
modules/webform_submission_log/webform_submission_log.routing.yml

File

src/Controller/WebformSubmissionViewController.php, line 104

Class

WebformSubmissionViewController
Defines a controller to render a single webform submission.

Namespace

Drupal\webform\Controller

Code

public function title(EntityInterface $webform_submission, $duplicate = FALSE) {
  $title = $this->entityRepository
    ->getTranslationFromContext($webform_submission)
    ->label();
  return $duplicate ? $this
    ->t('Duplicate @title', [
    '@title' => $title,
  ]) : $title;
}