function NodeController::addPageTitle

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

The _title_callback for the node.add route.

Parameters

\Drupal\node\NodeTypeInterface $node_type: The current node.

Return value

string The page title.

1 string reference to 'NodeController::addPageTitle'
node.routing.yml in core/modules/node/node.routing.yml
core/modules/node/node.routing.yml

File

core/modules/node/src/Controller/NodeController.php, line 311

Class

NodeController
Returns responses for Node routes.

Namespace

Drupal\node\Controller

Code

public function addPageTitle(NodeTypeInterface $node_type) {
    return $this->t('Create @name', [
        '@name' => $node_type->label(),
    ]);
}

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