function config_pages_get_route_name_from_path in Config Pages 8.2
Same name and namespace in other branches
- 8.3 config_pages.module \config_pages_get_route_name_from_path()
- 8 config_pages.module \config_pages_get_route_name_from_path()
Returns route name or false.
Parameters
string $path: Path.
Return value
string|false Route name or false.
1 call to config_pages_get_route_name_from_path()
- config_pages_find_parent_route_name in ./
config_pages.module - Return parent route name or false.
File
- ./
config_pages.module, line 189 - Module hooks.
Code
function config_pages_get_route_name_from_path($path) {
$path_validator = Drupal::service('path.validator');
$url_object = $path_validator
->getUrlIfValidWithoutAccessCheck($path);
if ($url_object instanceof Url) {
return $url_object
->getRouteName();
}
return FALSE;
}