LanguageNegotiationUrl
class LanguageNegotiationUrl extends LanguageNegotiationMethodBase implements InboundPathProcessorInterface, OutboundPathProcessorInterface, LanguageSwitcherInterface (View source)
Class for identifying language via URL prefix or domain.
Constants
| METHOD_ID |
The language negotiation method id. |
| CONFIG_PATH_PREFIX |
URL language negotiation: use the path prefix as URL language indicator. |
| CONFIG_DOMAIN |
URL language negotiation: use the domain as URL language indicator. |
Properties
| protected LanguageManagerInterface | $languageManager | The language manager. |
from LanguageNegotiationMethodBase |
| protected ConfigFactoryInterface | $config | The configuration factory. |
from LanguageNegotiationMethodBase |
| protected AccountInterface | $currentUser | The current active user. |
from LanguageNegotiationMethodBase |
Methods
Injects the language manager.
Notifies the plugin that the language code it returned has been accepted.
Performs language negotiation.
Processes the inbound path.
Processes the outbound path.
Details
setLanguageManager(ConfigurableLanguageManagerInterface $language_manager)
Injects the language manager.
setConfig(ConfigFactoryInterface $config)
Injects the configuration factory.
setCurrentUser(AccountInterface $current_user)
Injects the current user.
persist(LanguageInterface $language)
Notifies the plugin that the language code it returned has been accepted.
string
getLangcode(Request $request = NULL)
Performs language negotiation.
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.
array
getLanguageSwitchLinks(Request $request, string $type, Url $url)
Returns language switch links.