interface TitleResolverInterface in Drupal 9
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/Controller/TitleResolverInterface.php \Drupal\Core\Controller\TitleResolverInterface
Defines a class which knows how to generate the title from a given route.
Hierarchy
- interface \Drupal\Core\Controller\TitleResolverInterface
Expanded class hierarchy of TitleResolverInterface
All classes that implement TitleResolverInterface
6 files declare their use of TitleResolverInterface
- DialogRenderer.php in core/
lib/ Drupal/ Core/ Render/ MainContent/ DialogRenderer.php - HtmlRenderer.php in core/
lib/ Drupal/ Core/ Render/ MainContent/ HtmlRenderer.php - JsonRenderer.php in core/
modules/ system/ tests/ modules/ common_test/ src/ Render/ MainContent/ JsonRenderer.php - OffCanvasRenderer.php in core/
lib/ Drupal/ Core/ Render/ MainContent/ OffCanvasRenderer.php - PathBasedBreadcrumbBuilder.php in core/
modules/ system/ src/ PathBasedBreadcrumbBuilder.php
File
- core/
lib/ Drupal/ Core/ Controller/ TitleResolverInterface.php, line 11
Namespace
Drupal\Core\ControllerView source
interface TitleResolverInterface {
/**
* Returns a static or dynamic title for the route.
*
* If the returned title can contain HTML that should not be escaped it should
* return a render array, for example:
* @code
* ['#markup' => 'title', '#allowed_tags' => ['em']]
* @endcode
* If the method returns a string and it is not marked safe then it will be
* auto-escaped.
*
* @param \Symfony\Component\HttpFoundation\Request $request
* The request object passed to the title callback.
* @param \Symfony\Component\Routing\Route $route
* The route information of the route to fetch the title.
*
* @return array|string|null
* The title for the route.
*/
public function getTitle(Request $request, Route $route);
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
TitleResolverInterface:: |
public | function | Returns a static or dynamic title for the route. | 1 |