function NodePreviewController::title

Same name in other branches
  1. 8.9.x core/modules/node/src/Controller/NodePreviewController.php \Drupal\node\Controller\NodePreviewController::title()
  2. 10 core/modules/node/src/Controller/NodePreviewController.php \Drupal\node\Controller\NodePreviewController::title()
  3. 11.x core/modules/node/src/Controller/NodePreviewController.php \Drupal\node\Controller\NodePreviewController::title()

The _title_callback for the page that renders a single node in preview.

Parameters

\Drupal\Core\Entity\EntityInterface $node_preview: The current node.

Return value

string The page title.

1 string reference to 'NodePreviewController::title'
node.routing.yml in core/modules/node/node.routing.yml
core/modules/node/node.routing.yml

File

core/modules/node/src/Controller/NodePreviewController.php, line 74

Class

NodePreviewController
Defines a controller to render a single node in preview.

Namespace

Drupal\node\Controller

Code

public function title(EntityInterface $node_preview) {
    return $this->entityRepository
        ->getTranslationFromContext($node_preview)
        ->label();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.