function LanguageNegotiationSelected::getLangcode

Same name in other branches
  1. 8.9.x core/modules/language/src/Plugin/LanguageNegotiation/LanguageNegotiationSelected.php \Drupal\language\Plugin\LanguageNegotiation\LanguageNegotiationSelected::getLangcode()
  2. 10 core/modules/language/src/Plugin/LanguageNegotiation/LanguageNegotiationSelected.php \Drupal\language\Plugin\LanguageNegotiation\LanguageNegotiationSelected::getLangcode()
  3. 11.x core/modules/language/src/Plugin/LanguageNegotiation/LanguageNegotiationSelected.php \Drupal\language\Plugin\LanguageNegotiation\LanguageNegotiationSelected::getLangcode()

Overrides LanguageNegotiationMethodInterface::getLangcode

File

core/modules/language/src/Plugin/LanguageNegotiation/LanguageNegotiationSelected.php, line 29

Class

LanguageNegotiationSelected
Class for identifying language from a selected language.

Namespace

Drupal\language\Plugin\LanguageNegotiation

Code

public function getLangcode(Request $request = NULL) {
    $langcode = NULL;
    if ($this->languageManager) {
        $langcode = $this->config
            ->get('language.negotiation')
            ->get('selected_langcode');
    }
    return $langcode;
}

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