Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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