Skip to content

Instantly share code, notes, and snippets.

@slivorezka
Created October 26, 2016 15:35
Show Gist options
  • Save slivorezka/d8fc4ca22fd677addc13347a0d94a2c0 to your computer and use it in GitHub Desktop.
Save slivorezka/d8fc4ca22fd677addc13347a0d94a2c0 to your computer and use it in GitHub Desktop.
Drupal 8: get current router name
<?php
// Get current router name.
$current_router = \Drupal::routeMatch()->getRouteName();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment