You are here

public function LanguageSwitcherExtendedSettingsForm::submitForm in Language Switcher Extended 8

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

src/Form/LanguageSwitcherExtendedSettingsForm.php, line 124

Class

LanguageSwitcherExtendedSettingsForm
Configure language_switcher_extended settings for this site.

Namespace

Drupal\language_switcher_extended\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $config = $this
    ->config('language_switcher_extended.settings');
  $config
    ->set('mode', $form_state
    ->getValue('mode'));
  $config
    ->set('untranslated_handler', $form_state
    ->getValue('untranslated_handler'));
  $config
    ->set('current_language_mode', $form_state
    ->getValue('current_language_mode'));
  $config
    ->set('hide_single_link', $form_state
    ->getValue('hide_single_link'));
  $config
    ->set('hide_single_link_block', $form_state
    ->getValue('hide_single_link_block'));
  $config
    ->set('show_langcode', $form_state
    ->getValue('show_langcode'));
  $config
    ->save();
  parent::submitForm($form, $form_state);
}