public function onKernelRequest(GetResponseEvent $event)
    {
        $request = $event->getRequest();
        $theme = $this->activeTheme->getName();
        $controllers = $request->attributes->get(static::ATTRIBUTE_KEY);
        if (isset($controllers[$theme])) {
            $request->attributes->set('_controller', $controllers[$theme]);
        }

        // Get rid of the attribute in the request to avoid it showing up in generated URLs
        $request->attributes->remove(static::ATTRIBUTE_KEY);
        $routeParams = $request->attributes->get('_route_params');
        if (null !== $routeParams) {
            unset($routeParams[static::ATTRIBUTE_KEY]);
            $request->attributes->set('_route_params', $routeParams);
        }
    }
public function onKernelRequest(GetResponseEvent $event)
    {
        $request = $event->getRequest();
        $theme = $this->activeTheme->getName();
        $controllers = $request->attributes->get(static::ATTRIBUTE_KEY);
        if (isset($controllers[$theme])) {
            $request->attributes->set('_controller', $controllers[$theme]);
        }

        // Get rid of the attribute in the request to avoid it showing up in generated URLs
        $request->attributes->remove(static::ATTRIBUTE_KEY);
        $routeParams = $request->attributes->get('_route_params');
        if (null !== $routeParams) {
            unset($routeParams[static::ATTRIBUTE_KEY]);
            $request->attributes->set('_route_params', $routeParams);
        }
    }
public function onKernelRequest ( GetResponseEvent $ event ) { $ request = $ event -> getRequest ( ) ; $ theme = $ this -> activeTheme -> getName ( ) ; $ controllers = $ request -> attributes -> get ( static :: ATTRIBUTE_KEY ) ; if ( isset ( $ controllers [ $ theme ] ) ) { $ request -> attributes -> set ( '_controller' , $ controllers [ $ theme ] ) ; } // Get rid of the attribute in the request to avoid it showing up in generated URLs $ request -> attributes -> remove ( static :: ATTRIBUTE_KEY ) ; $ routeParams = $ request -> attributes -> get ( '_route_params' ) ; if ( null !== $ routeParams ) { unset ( $ routeParams [ static :: ATTRIBUTE_KEY ] ) ; $ request -> attributes -> set ( '_route_params' , $ routeParams ) ; } }
Kick in right after routing and check if the route defines options to
use a different controller for the new theme.

@param GetResponseEvent $event
Kick in right after routing and check if the route defines options to use a different controller for the new theme .