function NegotiationBrowserForm::submitForm

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

Overrides ConfigFormBase::submitForm

File

core/modules/language/src/Form/NegotiationBrowserForm.php, line 189

Class

NegotiationBrowserForm
Configure the browser language negotiation method for this site.

Namespace

Drupal\language\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
    $mappings = $form_state->get('mappings');
    if (!empty($mappings)) {
        $config = $this->config('language.mappings');
        $config->setData([
            'map' => $mappings,
        ]);
        $config->save();
    }
    parent::submitForm($form, $form_state);
}

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