function LanguageManagerInterface::getLanguageSwitchLinks

Same name in other branches
  1. 9 core/lib/Drupal/Core/Language/LanguageManagerInterface.php \Drupal\Core\Language\LanguageManagerInterface::getLanguageSwitchLinks()
  2. 8.9.x core/lib/Drupal/Core/Language/LanguageManagerInterface.php \Drupal\Core\Language\LanguageManagerInterface::getLanguageSwitchLinks()
  3. 11.x core/lib/Drupal/Core/Language/LanguageManagerInterface.php \Drupal\Core\Language\LanguageManagerInterface::getLanguageSwitchLinks()

Returns the language switch links for the given language type.

Parameters

string $type: The language type.

\Drupal\Core\Url $url: The URL the switch links will be relative to.

Return value

object|null An object with the following keys:

  • links: An array of links indexed by the language ID
  • method_id: The language negotiation method ID

or NULL if there are no language switch links.

File

core/lib/Drupal/Core/Language/LanguageManagerInterface.php, line 180

Class

LanguageManagerInterface
Common interface for the language manager service.

Namespace

Drupal\Core\Language

Code

public function getLanguageSwitchLinks($type, Url $url);

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