You are here

final class LanguageNegotiationLanguageSelectionPage in Language Selection Page 8.2

Class for identifying language from a language selection page.

Plugin annotation


@LanguageNegotiation(
    weight=-4,
    name=@Translation("Language Selection Page"),
    description=@Translation("Language is set from a language selection page"),
    id=Drupal\language_selection_page\Plugin\LanguageNegotiation\LanguageNegotiationLanguageSelectionPage::METHOD_ID,
    types={\Drupal\Core\Language\LanguageInterface::TYPE_INTERFACE},
    config_route_name="language_selection_page.negotiation_selection_page"
)

Hierarchy

Expanded class hierarchy of LanguageNegotiationLanguageSelectionPage

3 files declare their use of LanguageNegotiationLanguageSelectionPage
LanguageSelectionPageConditionMethodIsValid.php in src/Plugin/LanguageSelectionPageCondition/LanguageSelectionPageConditionMethodIsValid.php
LanguageSelectionPageSubscriber.php in src/EventSubscriber/LanguageSelectionPageSubscriber.php
language_selection_page.install in ./language_selection_page.install

File

src/Plugin/LanguageNegotiation/LanguageNegotiationLanguageSelectionPage.php, line 22

Namespace

Drupal\language_selection_page\Plugin\LanguageNegotiation
View source
final class LanguageNegotiationLanguageSelectionPage extends LanguageNegotiationMethodBase {

  /**
   * The language negotiation method id.
   */
  public const METHOD_ID = 'language-selection-page';

  /**
   * {@inheritdoc}
   */
  public function getLangcode(?Request $request = NULL) {

    // Negotiation is always "unsuccessful". We link to the possible language
    // versions in the language page itself.
    return FALSE;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
LanguageNegotiationLanguageSelectionPage::getLangcode public function Performs language negotiation. Overrides LanguageNegotiationMethodInterface::getLangcode
LanguageNegotiationLanguageSelectionPage::METHOD_ID public constant The language negotiation method id.
LanguageNegotiationMethodBase::$config protected property The configuration factory.
LanguageNegotiationMethodBase::$currentUser protected property The current active user.
LanguageNegotiationMethodBase::$languageManager protected property The language manager.
LanguageNegotiationMethodBase::persist public function Notifies the plugin that the language code it returned has been accepted. Overrides LanguageNegotiationMethodInterface::persist 1
LanguageNegotiationMethodBase::setConfig public function Injects the configuration factory. Overrides LanguageNegotiationMethodInterface::setConfig
LanguageNegotiationMethodBase::setCurrentUser public function Injects the current user. Overrides LanguageNegotiationMethodInterface::setCurrentUser
LanguageNegotiationMethodBase::setLanguageManager public function Injects the language manager. Overrides LanguageNegotiationMethodInterface::setLanguageManager