You are here

public function EntityLegalController::documentPageTitle in Entity Legal 3.0.x

Same name and namespace in other branches
  1. 8.2 src/Controller/EntityLegalController.php \Drupal\entity_legal\Controller\EntityLegalController::documentPageTitle()
  2. 4.0.x src/Controller/EntityLegalController.php \Drupal\entity_legal\Controller\EntityLegalController::documentPageTitle()

Page title callback for the Entity Legal Document.

Parameters

\Drupal\entity_legal\EntityLegalDocumentInterface $entity_legal_document: The Entity Legal Document entity.

\Drupal\entity_legal\EntityLegalDocumentVersionInterface|null $entity_legal_document_version: The Entity Legal Document version entity.

1 string reference to 'EntityLegalController::documentPageTitle'
entity_legal.routing.yml in ./entity_legal.routing.yml
entity_legal.routing.yml

File

src/Controller/EntityLegalController.php, line 102

Class

EntityLegalController
Class EntityLegalController.

Namespace

Drupal\entity_legal\Controller

Code

public function documentPageTitle(EntityLegalDocumentInterface $entity_legal_document, EntityLegalDocumentVersionInterface $entity_legal_document_version = NULL) {
  if (is_null($entity_legal_document_version)) {
    $entity_legal_document_version = $entity_legal_document
      ->getPublishedVersion();
  }
  $pattern = $entity_legal_document
    ->get('settings')['title_pattern'];
  return $this->token
    ->replace($pattern, [
    ENTITY_LEGAL_DOCUMENT_ENTITY_NAME => $entity_legal_document,
  ]);
}