You are here

public function GlobalredirectSettingsForm::submitForm in Global Redirect 8

Compares the submitted settings to the defaults and unsets any that are equal. This was we only store overrides.

Overrides ConfigFormBase::submitForm

File

src/Form/GlobalredirectSettingsForm.php, line 127
This is the GlobalRedirect admin include which provides an interface to global redirect to change some of the default settings Contains \Drupal\globalredirect\Form\GlobalredirectSettingsForm.

Class

GlobalredirectSettingsForm
Defines a form to configure module settings.

Namespace

Drupal\globalredirect\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {

  // Get config factory
  $config = $this
    ->config('globalredirect.settings');
  $form_values = $form_state
    ->getValue([
    'settings',
  ]);
  $config
    ->set('deslash', $form_values['deslash'])
    ->set('nonclean_to_clean', $form_values['nonclean_to_clean'])
    ->set('access_check', $form_values['access_check'])
    ->set('normalize_aliases', $form_values['normalize_aliases'])
    ->set('canonical', $form_values['canonical'])
    ->set('content_location_header', $form_values['content_location_header'])
    ->set('term_path_handler', $form_values['term_path_handler'])
    ->set('frontpage_redirect', $form_values['frontpage_redirect'])
    ->set('ignore_admin_path', $form_values['ignore_admin_path'])
    ->save();
  parent::submitForm($form, $form_state);
}