1<?php 2 3namespace Drupal\Core\Controller; 4 5use Symfony\Component\Routing\Route; 6use Symfony\Component\HttpFoundation\Request; 7 8/** 9 * Defines a class which knows how to generate the title from a given route. 10 */ 11interface TitleResolverInterface { 12 13 /** 14 * Returns a static or dynamic title for the route. 15 * 16 * If the returned title can contain HTML that should not be escaped it should 17 * return a render array, for example: 18 * @code 19 * ['#markup' => 'title', '#allowed_tags' => ['em']] 20 * @endcode 21 * If the method returns a string and it is not marked safe then it will be 22 * auto-escaped. 23 * 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. 28 * 29 * @return array|string|null 30 * The title for the route. 31 */ 32 public function getTitle(Request $request, Route $route); 33 34} 35