View D8GetCurrentPathAlias.php
$path = \Drupal::service('path.current')->getPath(); | |
$alias = \Drupal::service('path.alias_manager')->getAliasByPath($path); |