|
|
@ -888,10 +888,10 @@ class TwigExtension extends AbstractExtension { |
|
|
|
* A render array to represent page title. |
|
|
|
* A render array to represent page title. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public function drupalTitle() { |
|
|
|
public function drupalTitle() { |
|
|
|
$title = \Drupal::service('title_resolver')->getTitle( |
|
|
|
$title = NULL; |
|
|
|
\Drupal::request(), |
|
|
|
if ($route = \Drupal::routeMatch()->getRouteObject()) { |
|
|
|
\Drupal::routeMatch()->getRouteObject() |
|
|
|
$title = \Drupal::service('title_resolver')->getTitle(\Drupal::request(), $route); |
|
|
|
); |
|
|
|
} |
|
|
|
$build['#markup'] = render($title); |
|
|
|
$build['#markup'] = render($title); |
|
|
|
$build['#cache']['contexts'] = ['url']; |
|
|
|
$build['#cache']['contexts'] = ['url']; |
|
|
|
return $build; |
|
|
|
return $build; |
|
|
|