3 namespace Drupal\Core\Controller;
5 use Symfony\Component\Routing\Route;
6 use Symfony\Component\HttpFoundation\Request;
9 * Defines a class which knows how to generate the title from a given route.
11 interface TitleResolverInterface {
14 * Returns a static or dynamic title for the route.
16 * If the returned title can contain HTML that should not be escaped it should
17 * return a render array, for example:
19 * ['#markup' => 'title', '#allowed_tags' => ['em']]
21 * If the method returns a string and it is not marked safe then it will be
24 * @param \Symfony\Component\HttpFoundation\Request $request
25 * The request object passed to the title callback.
26 * @param \Symfony\Component\Routing\Route $route
27 * The route information of the route to fetch the title.
29 * @return array|string|null
30 * The title for the route.
32 public function getTitle(Request $request, Route $route);