Here is the code to get the url alias for particular page using Drupal 8
$input_path_alias = \Drupal::service('path.alias_manager')->getAliasByPath("/node/1", 'en');
Note: Do not forget to include slash at front ("/node/1")
I hope this helps.
$input_path_alias = \Drupal::service('path.alias_manager')->getAliasByPath("/node/1", 'en');
Note: Do not forget to include slash at front ("/node/1")
I hope this helps.