You are here

public function SettingsForm::submitForm in CookieConsent 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/SettingsForm.php, line 199
Contains Drupal\cookieconsent\Form\SettingsForm.

Class

SettingsForm
Class SettingsForm.

Namespace

Drupal\cookieconsent\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  parent::submitForm($form, $form_state);
  $this
    ->config('cookieconsent.settings')
    ->set('minified', $form_state
    ->getValue('minified'))
    ->set('theme', $form_state
    ->getValue('theme'))
    ->set('theme_path', $form_state
    ->getValue('theme_path'))
    ->set('customise', $form_state
    ->getValue('customise'))
    ->set('headline_text', $form_state
    ->getValue('headline_text'))
    ->set('accept_button_text', $form_state
    ->getValue('accept_button_text'))
    ->set('read_more_button_text', $form_state
    ->getValue('read_more_button_text'))
    ->set('cookie_policy', $form_state
    ->getValue('cookie_policy'))
    ->set('container', $form_state
    ->getValue('container'))
    ->set('path', $form_state
    ->getValue('path'))
    ->set('expiry', $form_state
    ->getValue('expiry'))
    ->set('target', $form_state
    ->getValue('target'))
    ->save();
}