How to get the current path in Drupal 8 How to get the current path1 $current_path = \Drupal::request()->getRequestUri();