Skip to content

Instantly share code, notes, and snippets.

@vkechagias
Last active January 15, 2019 14:23
Show Gist options
  • Save vkechagias/6f5a9322287a77fd2e1a82d1b686fa23 to your computer and use it in GitHub Desktop.
Save vkechagias/6f5a9322287a77fd2e1a82d1b686fa23 to your computer and use it in GitHub Desktop.
Drupal 8: Get current page route name
function THEME_preprocess_page(&$variables) {
$variables['route_name'] = \Drupal::routeMatch()->getRouteName();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment