function MenuTestController::titleCallback

Same name in other branches
  1. 9 core/modules/system/tests/modules/menu_test/src/Controller/MenuTestController.php \Drupal\menu_test\Controller\MenuTestController::titleCallback()
  2. 8.9.x core/modules/system/tests/modules/menu_test/src/Controller/MenuTestController.php \Drupal\menu_test\Controller\MenuTestController::titleCallback()
  3. 11.x core/modules/system/tests/modules/menu_test/src/Controller/MenuTestController.php \Drupal\menu_test\Controller\MenuTestController::titleCallback()

A title callback method for test routes.

Parameters

array $_title_arguments: Optional array from the route defaults.

string $_title: Optional _title string from the route defaults.

Return value

string The route title.

1 string reference to 'MenuTestController::titleCallback'
menu_test.routing.yml in core/modules/system/tests/modules/menu_test/menu_test.routing.yml
core/modules/system/tests/modules/menu_test/menu_test.routing.yml

File

core/modules/system/tests/modules/menu_test/src/Controller/MenuTestController.php, line 85

Class

MenuTestController
Controller routines for menu_test routes.

Namespace

Drupal\menu_test\Controller

Code

public function titleCallback(array $_title_arguments = [], $_title = '') {
    $_title_arguments += [
        'case_number' => '2',
        'title' => $_title,
    ];
    return t($_title_arguments['title']) . ' - Case ' . $_title_arguments['case_number'];
}

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