interface LanguageSwitcherInterface

Same name in other branches
  1. 9 core/modules/language/src/LanguageSwitcherInterface.php \Drupal\language\LanguageSwitcherInterface
  2. 8.9.x core/modules/language/src/LanguageSwitcherInterface.php \Drupal\language\LanguageSwitcherInterface
  3. 10 core/modules/language/src/LanguageSwitcherInterface.php \Drupal\language\LanguageSwitcherInterface

Interface for language switcher classes.

Hierarchy

Expanded class hierarchy of LanguageSwitcherInterface

All classes that implement LanguageSwitcherInterface

3 files declare their use of LanguageSwitcherInterface
LanguageNegotiationContentEntity.php in core/modules/language/src/Plugin/LanguageNegotiation/LanguageNegotiationContentEntity.php
LanguageNegotiationSession.php in core/modules/language/src/Plugin/LanguageNegotiation/LanguageNegotiationSession.php
LanguageNegotiationUrl.php in core/modules/language/src/Plugin/LanguageNegotiation/LanguageNegotiationUrl.php

File

core/modules/language/src/LanguageSwitcherInterface.php, line 11

Namespace

Drupal\language
View source
interface LanguageSwitcherInterface {
    
    /**
     * Returns language switch links.
     *
     * @param \Symfony\Component\HttpFoundation\Request $request
     *   The current request.
     * @param string $type
     *   The language type.
     * @param \Drupal\Core\Url $url
     *   The URL the switch links will be relative to.
     *
     * @return array
     *   An array of link arrays keyed by language code.
     */
    public function getLanguageSwitchLinks(Request $request, $type, Url $url);

}

Members

Title Sort descending Modifiers Object type Summary Overrides
LanguageSwitcherInterface::getLanguageSwitchLinks public function Returns language switch links. 3

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