Created
January 24, 2017 14:35
-
-
Save philwolstenholme/4cbfdc7f0552b7932fda9452fe7320c8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Implements hook_views_post_render(). | |
*/ | |
function MODULE_NAME_views_post_render($view) { | |
if ($view->id() !== 'VIEW_ID' && $view->getDisplay()->getPluginId() !== 'page') { | |
return; | |
} | |
$request = \Drupal::request(); | |
if ($route = $request->attributes->get(\Symfony\Cmf\Component\Routing\RouteObjectInterface::ROUTE_OBJECT)) { | |
$new_title = $view->getTitle(); | |
$route->setDefault('_title', $new_title); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment