Chris@0: routeMatch = $route_match; Chris@0: } Chris@0: Chris@0: /** Chris@0: * Determines whether the active route is an admin one. Chris@0: * Chris@0: * @param \Symfony\Component\Routing\Route $route Chris@0: * (optional) The route to determine whether it is an admin one. Per default Chris@0: * this falls back to the route object on the active request. Chris@0: * Chris@0: * @return bool Chris@0: * Returns TRUE if the route is an admin one, otherwise FALSE. Chris@0: */ Chris@0: public function isAdminRoute(Route $route = NULL) { Chris@0: if (!$route) { Chris@0: $route = $this->routeMatch->getRouteObject(); Chris@0: if (!$route) { Chris@0: return FALSE; Chris@0: } Chris@0: } Chris@0: return (bool) $route->getOption('_admin_route'); Chris@0: } Chris@0: Chris@0: }