function NegotiationSelectedForm::submitForm

Same name in other branches
  1. 9 core/modules/language/src/Form/NegotiationSelectedForm.php \Drupal\language\Form\NegotiationSelectedForm::submitForm()
  2. 8.9.x core/modules/language/src/Form/NegotiationSelectedForm.php \Drupal\language\Form\NegotiationSelectedForm::submitForm()
  3. 10 core/modules/language/src/Form/NegotiationSelectedForm.php \Drupal\language\Form\NegotiationSelectedForm::submitForm()

Overrides ConfigFormBase::submitForm

File

core/modules/language/src/Form/NegotiationSelectedForm.php, line 48

Class

NegotiationSelectedForm
Configure the selected language negotiation method for this site.

Namespace

Drupal\language\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
    $this->config('language.negotiation')
        ->set('selected_langcode', $form_state->getValue('selected_langcode'))
        ->save();
    parent::submitForm($form, $form_state);
}

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