You are here

function config_pages_get_route_name_from_path in Config Pages 8

Same name and namespace in other branches
  1. 8.3 config_pages.module \config_pages_get_route_name_from_path()
  2. 8.2 config_pages.module \config_pages_get_route_name_from_path()

Parameters

string $path: Get route name from path.

Return value

mixed Route name or false.

1 call to config_pages_get_route_name_from_path()
config_pages_find_parent_route_name in ./config_pages.module

File

./config_pages.module, line 153
Module hooks.

Code

function config_pages_get_route_name_from_path($path) {
  $route = \Drupal::service('path.validator')
    ->getUrlIfValid($path);
  return $route ? $route
    ->getRouteName() : FALSE;
}