示例#1
0
 public function finalMatch(RouteCollection $collection, Request $request)
 {
     $this->routes = $collection;
     $context = new RequestContext();
     $context->fromRequest($request);
     $this->setContext($context);
     return $this->match($this->currentPath->getPath($request));
 }
 public function finalMatch(RouteCollection $collection, Request $request)
 {
     $this->routes = $collection;
     $context = new RequestContext();
     $context->fromRequest($request);
     $this->setContext($context);
     if ($request->attributes->has('_system_path')) {
         // _system_path never has leading or trailing slashes.
         $path = '/' . $request->attributes->get('_system_path');
     } else {
         // getPathInfo() always has leading slash, and might or might not have a
         // trailing slash.
         $path = rtrim($request->getPathInfo(), '/');
     }
     return $this->match($path);
 }