You are here

public function QuicklinkConfigForm::submitForm in Quicklink 8

Same name and namespace in other branches
  1. 2.0.x src/Form/QuicklinkConfigForm.php \Drupal\quicklink\Form\QuicklinkConfigForm::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

src/Form/QuicklinkConfigForm.php, line 233

Class

QuicklinkConfigForm
Class QuicklinkConfig.

Namespace

Drupal\quicklink\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  parent::submitForm($form, $form_state);
  $this
    ->config('quicklink.settings')
    ->set('no_load_content_types', array_filter($form_state
    ->getValue('no_load_content_types')))
    ->set('selector', trim($form_state
    ->getValue('selector')))
    ->set('url_patterns_to_ignore', trim($form_state
    ->getValue('url_patterns_to_ignore')))
    ->set('prefetch_only_paths', trim($form_state
    ->getValue('prefetch_only_paths')))
    ->set('no_load_when_authenticated', $form_state
    ->getValue('no_load_when_authenticated'))
    ->set('no_load_when_session', $form_state
    ->getValue('no_load_when_session'))
    ->set('ignore_admin_paths', $form_state
    ->getValue('ignore_admin_paths'))
    ->set('ignore_ajax_links', $form_state
    ->getValue('ignore_ajax_links'))
    ->set('ignore_hashes', $form_state
    ->getValue('ignore_hashes'))
    ->set('ignore_file_ext', $form_state
    ->getValue('ignore_file_ext'))
    ->set('allowed_domains', trim($form_state
    ->getValue('allowed_domains')))
    ->set('load_polyfill', $form_state
    ->getValue('load_polyfill'))
    ->set('enable_debug_mode', $form_state
    ->getValue('enable_debug_mode'))
    ->save();
}