You are here

public function NegotiationBrowserForm::submitForm in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/language/src/Form/NegotiationBrowserForm.php \Drupal\language\Form\NegotiationBrowserForm::submitForm()

Form submission handler.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

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);
}