function LanguageNegotiator::getPrimaryNegotiationMethod

Same name in other branches
  1. 9 core/modules/language/src/LanguageNegotiator.php \Drupal\language\LanguageNegotiator::getPrimaryNegotiationMethod()
  2. 10 core/modules/language/src/LanguageNegotiator.php \Drupal\language\LanguageNegotiator::getPrimaryNegotiationMethod()
  3. 11.x core/modules/language/src/LanguageNegotiator.php \Drupal\language\LanguageNegotiator::getPrimaryNegotiationMethod()

Overrides LanguageNegotiatorInterface::getPrimaryNegotiationMethod

File

core/modules/language/src/LanguageNegotiator.php, line 222

Class

LanguageNegotiator
Class responsible for performing language negotiation.

Namespace

Drupal\language

Code

public function getPrimaryNegotiationMethod($type) {
    $enabled_methods = $this->getEnabledNegotiators($type);
    return empty($enabled_methods) ? LanguageNegotiatorInterface::METHOD_ID : key($enabled_methods);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.