src/Twig/Extension/PageExtension.php
public function controller($controller, $attributes = [], $query = [])
    {
        if (!isset($attributes['pathInfo'])) {
            $site = $this->siteSelector->retrieve();
            if ($site) {
                $sitePath = $site->getRelativePath();
                $globals = $this->environment->getGlobals();
                $currentPathInfo = $globals['app']->getRequest()->getPathInfo();

                $attributes['pathInfo'] = $sitePath.$currentPathInfo;
            }
        }

        // Simplify this when dropping twig-bridge < 3.2 support
        if (method_exists(AppVariable::class, 'getToken')) {
            return HttpKernelExtension::controller($controller, $attributes, $query);
        }

        return $this->httpKernelExtension->controller($controller, $attributes, $query);
    }
public function controller($controller, $attributes = [], $query = [])
    {
        if (!isset($attributes['pathInfo'])) {
            $site = $this->siteSelector->retrieve();
            if ($site) {
                $sitePath = $site->getRelativePath();
                $globals = $this->environment->getGlobals();
                $currentPathInfo = $globals['app']->getRequest()->getPathInfo();

                $attributes['pathInfo'] = $sitePath.$currentPathInfo;
            }
        }

        // Simplify this when dropping twig-bridge < 3.2 support
        if (method_exists(AppVariable::class, 'getToken')) {
            return HttpKernelExtension::controller($controller, $attributes, $query);
        }

        return $this->httpKernelExtension->controller($controller, $attributes, $query);
    }
public function controller ( $ controller , $ attributes = [ ] , $ query = [ ] ) { if ( ! isset ( $ attributes [ 'pathInfo' ] ) ) { $ site = $ this -> siteSelector -> retrieve ( ) ; if ( $ site ) { $ sitePath = $ site -> getRelativePath ( ) ; $ globals = $ this -> environment -> getGlobals ( ) ; $ currentPathInfo = $ globals [ 'app' ] -> getRequest ( ) -> getPathInfo ( ) ; $ attributes [ 'pathInfo' ] = $ sitePath . $ currentPathInfo ; } } // Simplify this when dropping twig-bridge < 3.2 support if ( method_exists ( AppVariable :: class , 'getToken' ) ) { return HttpKernelExtension :: controller ( $ controller , $ attributes , $ query ) ; } return $ this -> httpKernelExtension -> controller ( $ controller , $ attributes , $ query ) ; }
Forwards pathInfo to subrequests.
Allows HostPathSiteSelector to work.

@param string $controller
@param array  $attributes
@param array  $query

@return ControllerReference
Forwards pathInfo to subrequests . Allows HostPathSiteSelector to work .