Skip to content

Instantly share code, notes, and snippets.

@DanLaufer
Created October 19, 2018 17:20
Show Gist options
  • Save DanLaufer/56ea933ef43066443360008d472373ce to your computer and use it in GitHub Desktop.
Save DanLaufer/56ea933ef43066443360008d472373ce to your computer and use it in GitHub Desktop.
Drupal 8 - Get path alias
$current_path = \Drupal::service('path.current')->getPath();
\Drupal::service('path.alias_manager')->getAliasByPath($current_path);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment