You are here

public function MenuController::menuTitle in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/menu_ui/src/Controller/MenuController.php \Drupal\menu_ui\Controller\MenuController::menuTitle()
  2. 10 core/modules/menu_ui/src/Controller/MenuController.php \Drupal\menu_ui\Controller\MenuController::menuTitle()

Route title callback.

Parameters

\Drupal\system\MenuInterface $menu: The menu entity.

Return value

array The menu label as a render array.

1 string reference to 'MenuController::menuTitle'
menu_ui.routing.yml in core/modules/menu_ui/menu_ui.routing.yml
core/modules/menu_ui/menu_ui.routing.yml

File

core/modules/menu_ui/src/Controller/MenuController.php, line 74

Class

MenuController
Returns responses for Menu routes.

Namespace

Drupal\menu_ui\Controller

Code

public function menuTitle(MenuInterface $menu) {
  return [
    '#markup' => $menu
      ->label(),
    '#allowed_tags' => Xss::getHtmlTagList(),
  ];
}