function NegotiationSessionForm::submitForm

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

Overrides ConfigFormBase::submitForm

File

core/modules/language/src/Form/NegotiationSessionForm.php, line 49

Class

NegotiationSessionForm
Configure the session language negotiation method for this site.

Namespace

Drupal\language\Form

Code

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

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