function LanguageNegotiator::getEnabledNegotiators

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

Gets enabled detection methods for the provided language type.

Parameters

string $type: The language type.

Return value

array An array of enabled detection methods for the provided language type.

5 calls to LanguageNegotiator::getEnabledNegotiators()
LanguageNegotiator::getNegotiationMethods in core/modules/language/src/LanguageNegotiator.php
Returns the language negotiation methods enabled for a language type.
LanguageNegotiator::getPrimaryNegotiationMethod in core/modules/language/src/LanguageNegotiator.php
Returns the ID of the language type's primary language negotiation method.
LanguageNegotiator::initializeType in core/modules/language/src/LanguageNegotiator.php
Initializes the specified language type.
LanguageNegotiator::isNegotiationMethodEnabled in core/modules/language/src/LanguageNegotiator.php
Checks whether a language negotiation method is enabled for a language type.
LanguageNegotiator::purgeConfiguration in core/modules/language/src/LanguageNegotiator.php
Resave the configuration to purge missing negotiation methods.

File

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

Class

LanguageNegotiator
Class responsible for performing language negotiation.

Namespace

Drupal\language

Code

protected function getEnabledNegotiators($type) {
    return $this->configFactory
        ->get('language.types')
        ->get('negotiation.' . $type . '.enabled') ?: [];
}

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