protected CurrentRouteMatch::getRouteMatch(Request $request)
Returns the route match for a passed in request.
\Symfony\Component\HttpFoundation\Request $request: A request object.
\Drupal\Core\Routing\RouteMatchInterface A route match object created from the request.
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; }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Routing!CurrentRouteMatch.php/function/CurrentRouteMatch::getRouteMatch/8.1.x