class ConfigSubscriber implements EventSubscriberInterface (View source)

Deletes the container if default language has changed.

Properties

protected LanguageManagerInterface $languageManager

The language manager.

protected LanguageDefault $languageDefault

The default language.

protected ConfigFactoryInterface $configFactory

The configuration factory.

protected LanguageNegotiatorInterface $languageNegotiator

The language negotiator.

protected PathProcessorLanguage $pathProcessorLanguage

The language path processor.

Methods

__construct(LanguageManagerInterface $language_manager, LanguageDefault $language_default, ConfigFactoryInterface $config_factory, LanguageNegotiatorInterface $language_negotiator)

Constructs a new class object.

onConfigSave(ConfigCrudEvent $event)

Causes the container to be rebuilt on the next request.

setPathProcessorLanguage(PathProcessorLanguage $path_processor_language)

Injects the language path processors on multilingual site configuration.

static 
getSubscribedEvents()

{@inheritdoc}

Details

__construct(LanguageManagerInterface $language_manager, LanguageDefault $language_default, ConfigFactoryInterface $config_factory, LanguageNegotiatorInterface $language_negotiator)

Constructs a new class object.

Parameters

LanguageManagerInterface $language_manager

The language manager.

LanguageDefault $language_default

The default language.

ConfigFactoryInterface $config_factory

The configuration factory.

LanguageNegotiatorInterface $language_negotiator

The language negotiator.

onConfigSave(ConfigCrudEvent $event)

Causes the container to be rebuilt on the next request.

This event subscriber assumes that the new default langcode and old default langcode are valid langcodes. If the schema definition of either system.site:default_langcode or language.negotiation::url.prefixes changes then this event must be changed to work with both the old and new schema definition so this event is update safe.

Parameters

ConfigCrudEvent $event

The configuration event.

setPathProcessorLanguage(PathProcessorLanguage $path_processor_language)

Injects the language path processors on multilingual site configuration.

Parameters

PathProcessorLanguage $path_processor_language

The language path processor.

static getSubscribedEvents()

{@inheritdoc}