Class

eZ\Publish\Core\MVC\Symfony\EventListener\LanguageSwitchListener

class LanguageSwitchListener implements EventSubscriberInterface

Listener for language switcher.

Will be triggered when generating a RouteReference.

Methods

__construct(TranslationHelper $translationHelper)

static  getSubscribedEvents()

onRouteReferenceGeneration(RouteReferenceGenerationEvent $event)

If "language" parameter is present, will try to get corresponding SiteAccess for translation.

Details

at line 27
public __construct(TranslationHelper $translationHelper)

Parameters

TranslationHelper $translationHelper

at line 32
static public getSubscribedEvents()

at line 49
public onRouteReferenceGeneration(RouteReferenceGenerationEvent $event)

If "language" parameter is present, will try to get corresponding SiteAccess for translation.

If found, it will add "siteaccess" parameter to the RouteReference, to trigger SiteAccess switch when generating the final link.

Parameters

RouteReferenceGenerationEvent $event

See also

\eZ\Publish\Core\MVC\Symfony\Routing\Generator::generate()
\eZ\Publish\Core\MVC\Symfony\Routing\Generator\UrlAliasGenerator::doGenerate()