drupal 8 get current route name code example Example: drupal 8 get page route $route_name = \Drupal::routeMatch()->getRouteName();