public function LanguageNegotiator::getPrimaryNegotiationMethod in Drupal 10
Same name and namespace in other branches
- 8 core/modules/language/src/LanguageNegotiator.php \Drupal\language\LanguageNegotiator::getPrimaryNegotiationMethod()
- 9 core/modules/language/src/LanguageNegotiator.php \Drupal\language\LanguageNegotiator::getPrimaryNegotiationMethod()
File
- core/
modules/ language/ src/ LanguageNegotiator.php, line 224
Class
- LanguageNegotiator
- Class responsible for performing language negotiation.
Namespace
Drupal\languageCode
public function getPrimaryNegotiationMethod($type) {
$enabled_methods = $this
->getEnabledNegotiators($type);
return empty($enabled_methods) ? LanguageNegotiatorInterface::METHOD_ID : key($enabled_methods);
}