You are here

public function QuickNodeCloneNodeController::clonePageTitle in Quick Node Clone 8

The _title_callback for the node.add route.

Parameters

\Drupal\node\Entity\Node $node: The current node.

Return value

string The page title.

1 string reference to 'QuickNodeCloneNodeController::clonePageTitle'
quick_node_clone.routing.yml in ./quick_node_clone.routing.yml
quick_node_clone.routing.yml

File

src/Controller/QuickNodeCloneNodeController.php, line 93

Class

QuickNodeCloneNodeController
Returns responses for Quick Node Clone Node routes.

Namespace

Drupal\quick_node_clone\Controller

Code

public function clonePageTitle(Node $node) {
  $prepend_text = "";
  $config = \Drupal::config('quick_node_clone.settings');
  if (!empty($config
    ->get('text_to_prepend_to_title'))) {
    $prepend_text = $config
      ->get('text_to_prepend_to_title') . " ";
  }
  return $prepend_text . $node
    ->getTitle();
}