getInitialRouteCollection example


  public function match($pathinfo): array {
    $request = Request::create($pathinfo);

    return $this->matchRequest($request);
  }

  /** * {@inheritdoc} */
  public function matchRequest(Request $request): array {
    $collection = $this->getInitialRouteCollection($request);
    if ($collection->count() === 0) {
      throw new ResourceNotFoundException(sprintf('No routes found for "%s".', $this->currentPath->getPath()));
    }
    $collection = $this->applyRouteFilters($collection$request);
    $collection = $this->applyFitOrder($collection);

    $ret = $this->matchCollection(rawurldecode($this->currentPath->getPath($request))$collection);
    return $this->applyRouteEnhancers($ret$request);
  }

  /** * {@inheritdoc} */
Home | Imprint | This part of the site doesn't use cookies.