Created
September 16, 2020 08:10
-
-
Save chloecorfmat/e51d348ae4bb7d98dfcfa92da4106235 to your computer and use it in GitHub Desktop.
D8 : Get current path alias
This file contains 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
$path = \Drupal::service('path.current')->getPath(); | |
$alias = \Drupal::service('path.alias_manager')->getAliasByPath($path); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment