Sulu\Bundle\RouteBundle\Routing\RouteProvider::createRoute PHP Method

createRoute() protected method

Will create a symfony route.
protected createRoute ( Sulu\Bundle\RouteBundle\Model\RouteInterface $route, Request $request ) : Symfony\Component\Routing\Route
$route Sulu\Bundle\RouteBundle\Model\RouteInterface
$request Symfony\Component\HttpFoundation\Request
return Symfony\Component\Routing\Route
    protected function createRoute(RouteInterface $route, Request $request)
    {
        $routePath = $this->requestAnalyzer->getResourceLocatorPrefix() . $route->getPath();
        if ($route->isHistory()) {
            return new Route($routePath, ['_controller' => 'SuluWebsiteBundle:Redirect:redirect', 'url' => $request->getSchemeAndHttpHost() . $this->requestAnalyzer->getResourceLocatorPrefix() . $route->getTarget()->getPath() . ($request->getQueryString() ? '?' . $request->getQueryString() : '')]);
        }
        $symfonyRoute = $this->proxyFactory->createProxy(Route::class, function (&$wrappedObject, LazyLoadingInterface $proxy, $method, array $parameters, &$initializer) use($routePath, $route, $request) {
            $initializer = null;
            // disable initialization
            $wrappedObject = new Route($routePath, $this->routeDefaultsProvider->getByEntity($route->getEntityClass(), $route->getEntityId(), $request->getLocale()));
            return true;
        });
        return $this->symfonyRouteCache[$route->getId()] = $symfonyRoute;
    }