PathProcessorLanguage
class PathProcessorLanguage implements InboundPathProcessorInterface, OutboundPathProcessorInterface (View source)
Processes the inbound path using path alias lookups.
Properties
| protected ConfigFactoryInterface | $config | A config factory for retrieving required config settings. |
|
| protected ConfigurableLanguageManagerInterface | $languageManager | Language manager for retrieving the url language type. |
|
| protected LanguageNegotiatorInterface | $negotiator | The language negotiator. |
|
| protected array | $processors | Local cache for language path processors. |
|
| protected bool | $multilingual | Flag indicating whether the site is multilingual. |
|
| protected ConfigSubscriber | $configSubscriber | The language configuration event subscriber. |
Methods
Constructs a PathProcessorLanguage object.
Processes the inbound path.
Processes the outbound path.
Initializes the local cache for language path processors.
Initializes the injected event subscriber with the language path processor.
Resets the collected processors instances.
Details
__construct(ConfigFactoryInterface $config, ConfigurableLanguageManagerInterface $language_manager, LanguageNegotiatorInterface $negotiator, AccountInterface $current_user, ConfigSubscriber $config_subscriber)
Constructs a PathProcessorLanguage object.
string
processInbound(string $path, Request $request)
Processes the inbound path.
Implementations may make changes to the request object passed in but should avoid all other side effects. This method can be called to process requests other than the current request.
string
processOutbound(string $path, array $options = [], Request $request = NULL, BubbleableMetadata $bubbleable_metadata = NULL)
Processes the outbound path.
protected
initProcessors(string $scope)
Initializes the local cache for language path processors.
initConfigSubscriber()
Initializes the injected event subscriber with the language path processor.
The language path processor service is registered only on multilingual site configuration, thus we inject it in the event subscriber only when it is initialized.
reset()
Resets the collected processors instances.