LanguageNegotiator::getNegotiationMethods

public LanguageNegotiator::getNegotiationMethods($type = NULL)

Returns the language negotiation methods enabled for a language type.

Parameters

string $type: (optional) The language type. If no type is specified all the method definitions are returned.

Return value

array[] An array of language negotiation method definitions keyed by method id.

Overrides LanguageNegotiatorInterface::getNegotiationMethods

File

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

Class

LanguageNegotiator
Class responsible for performing language negotiation.

Namespace

Drupal\language

Code

public function getNegotiationMethods($type = NULL) {
  $definitions = $this->negotiatorManager->getDefinitions();
  if (isset($type)) {
    $enabled_methods = $this->getEnabledNegotiators($type);
    $definitions = array_intersect_key($definitions, $enabled_methods);
  }
  return $definitions;
}
doc_Drupal
2016-10-29 09:22:51
Comments
Leave a Comment

Please login to continue.