function LanguageNegotiator::getNegotiationMethodInstance
Same name in other branches
- 9 core/modules/language/src/LanguageNegotiator.php \Drupal\language\LanguageNegotiator::getNegotiationMethodInstance()
- 8.9.x core/modules/language/src/LanguageNegotiator.php \Drupal\language\LanguageNegotiator::getNegotiationMethodInstance()
- 11.x core/modules/language/src/LanguageNegotiator.php \Drupal\language\LanguageNegotiator::getNegotiationMethodInstance()
File
-
core/
modules/ language/ src/ LanguageNegotiator.php, line 219
Class
- LanguageNegotiator
- Class responsible for performing language negotiation.
Namespace
Drupal\languageCode
public function getNegotiationMethodInstance($method_id) {
if (!isset($this->methods[$method_id])) {
$instance = $this->negotiatorManager
->createInstance($method_id, []);
$instance->setLanguageManager($this->languageManager);
$instance->setConfig($this->configFactory);
$instance->setCurrentUser($this->currentUser);
$this->methods[$method_id] = $instance;
}
return $this->methods[$method_id];
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.