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

Will be triggered when generating a RouteReference.
Inheritance: implements Symfony\Component\EventDispatcher\EventSubscriberInterface
显示文件 Open project: ezsystems/ezpublish-kernel Class Usage Examples

Public Methods

Method Description
__construct ( TranslationHelper $translationHelper )
getSubscribedEvents ( )
onRouteReferenceGeneration ( RouteReferenceGenerationEvent $event ) If "language" parameter is present, will try to get corresponding SiteAccess for translation.

Method Details

__construct() public method

public __construct ( TranslationHelper $translationHelper )
$translationHelper eZ\Publish\Core\Helper\TranslationHelper

getSubscribedEvents() public static method

public static getSubscribedEvents ( )

onRouteReferenceGeneration() public method

If found, it will add "siteaccess" parameter to the RouteReference, to trigger SiteAccess switch when generating the final link.
See also: eZ\Publish\Core\MVC\Symfony\Routing\Generator::generate()
See also: eZ\Publish\Core\MVC\Symfony\Routing\Generator\UrlAliasGenerator::doGenerate()
public onRouteReferenceGeneration ( RouteReferenceGenerationEvent $event )
$event eZ\Publish\Core\MVC\Symfony\Event\RouteReferenceGenerationEvent