LanguageNegotiationSession
class LanguageNegotiationSession extends LanguageNegotiationMethodBase implements OutboundPathProcessorInterface, LanguageSwitcherInterface (View source)
Identify language from a request/session parameter.
Constants
| METHOD_ID |
The language negotiation method id. |
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 |
| protected bool | $queryRewrite | Flag used to determine whether query rewriting is active. |
|
| protected string | $queryParam | The query parameter name to rewrite. |
|
| protected string | $queryValue | The query parameter value to be set. |
Methods
Injects the language manager.
Notifies the plugin that the language code it returned has been accepted.
Performs language negotiation.
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
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.