public function TokenTreeBrowseController::getTitle in Token 8
Title callback for the page outputting a link.
We are using a title callback instead of directly defining the title in the routing YML file. This is so that we could return an array instead of a simple string. This allows us to test if [current-page:title] works with render arrays and other objects as titles.
1 string reference to 'TokenTreeBrowseController::getTitle'
- token_module_test.routing.yml in tests/
modules/ token_module_test/ token_module_test.routing.yml - tests/modules/token_module_test/token_module_test.routing.yml
File
- tests/
modules/ token_module_test/ src/ Controller/ TokenTreeBrowseController.php, line 61
Class
- TokenTreeBrowseController
- Controller for token module test.
Namespace
Drupal\token_module_test\ControllerCode
public function getTitle() {
return [
'#type' => 'markup',
'#markup' => 'Available Tokens',
];
}