You are here

public function AjaxLoaderSettingsForm::submitForm in Ajax loader 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/AjaxLoaderSettingsForm.php, line 148

Class

AjaxLoaderSettingsForm
Class AjaxLoaderSettingsForm.

Namespace

Drupal\ajax_loader\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $this
    ->config('ajax_loader.settings')
    ->set('throbber', $form_state
    ->getValue('throbber'))
    ->set('hide_ajax_message', $form_state
    ->getValue('hide_ajax_message'))
    ->set('always_fullscreen', $form_state
    ->getValue('always_fullscreen'))
    ->set('show_admin_paths', $form_state
    ->getValue('show_admin_paths'))
    ->set('throbber_position', $form_state
    ->getValue('throbber_position'))
    ->save();

  // Clear cache, so that library is picked up.
  drupal_flush_all_caches();
  parent::submitForm($form, $form_state);
}