protected CurrentRouteMatch::getRouteMatch(Request $request)
Returns the route match for a passed in request.
Parameters
\Symfony\Component\HttpFoundation\Request $request: A request object.
Return value
\Drupal\Core\Routing\RouteMatchInterface A route match object created from the request.
File
- core/lib/Drupal/Core/Routing/CurrentRouteMatch.php, line 99
Class
- CurrentRouteMatch
- Default object for current_route_match service.
Namespace
Drupal\Core\Routing
Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | protected function getRouteMatch(Request $request ) { if (isset( $this ->routeMatches[ $request ])) { $route_match = $this ->routeMatches[ $request ]; } else { $route_match = RouteMatch::createFromRequest( $request ); // Since getRouteMatch() might be invoked both before and after routing // is completed, only statically cache the route match after there's a // matched route. if ( $route_match ->getRouteObject()) { $this ->routeMatches[ $request ] = $route_match ; } } return $route_match ; } |
Please login to continue.