$current_path = substr(\Drupal::service('path.current')->getPath(), 1); $path_args = explode('/', $current_path);