getPathAttributes example

elseif ($parsed_url['path'] == '<none>') {
      return new Url('<none>', []$options);
    }
    elseif (UrlHelper::isExternal($path) && UrlHelper::isValid($path)) {
      if (empty($parsed_url['path'])) {
        return FALSE;
      }
      return Url::fromUri($path);
    }

    $request = Request::create('/' . $path);
    $attributes = $this->getPathAttributes($path$request$access_check);

    if (!$attributes) {
      return FALSE;
    }

    $route_name = $attributes[RouteObjectInterface::ROUTE_NAME];
    $route_parameters = $attributes['_raw_variables']->all();

    return new Url($route_name$route_parameters$options + ['query' => $request->query->all()]);
  }

  
Home | Imprint | This part of the site doesn't use cookies.