You are here

public function CkeditorAccordionSettingsForm::submitForm in CKEditor Accordion 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/CkeditorAccordionSettingsForm.php, line 55

Class

CkeditorAccordionSettingsForm
Class CkeditorAccordionSettingsForm.

Namespace

Drupal\ckeditor_accordion\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $config = $this
    ->config('ckeditor_accordion.settings');
  $values = $form_state
    ->getValues();
  $config
    ->set('collapse_all', $values['collapse_all']);
  $config
    ->set('keep_rows_open', $values['keep_rows_open']);
  $config
    ->save();
  parent::submitForm($form, $form_state);
}