You are here

public function GoogleOptimizeHidePageAdminSettingsForm::submitForm in Drupal 8 Google Optimize Hide Page 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/GoogleOptimizeHidePageAdminSettingsForm.php, line 114

Class

GoogleOptimizeHidePageAdminSettingsForm
Implements Google Optimize Hide Page Admin Settings form.

Namespace

Drupal\d8_google_optimize_hide_page\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $this->configFactory
    ->getEditable('d8_google_optimize_hide_page.settings')
    ->set('google_optimize_hide_page_enable', $form_state
    ->getValue('google_optimize_hide_page_enable'))
    ->set('google_optimize_hide_page_container_ids', $form_state
    ->getValue('google_optimize_hide_page_container_ids'))
    ->set('google_optimize_hide_page_timeout', $form_state
    ->getValue('google_optimize_hide_page_timeout'))
    ->set('google_optimize_hide_page_class_name', $form_state
    ->getValue('google_optimize_hide_page_class_name'))
    ->set('google_optimize_hide_page_pages', $form_state
    ->getValue('google_optimize_hide_page_pages'))
    ->set('google_optimize_hide_page_roles', $form_state
    ->getValue('google_optimize_hide_page_roles'))
    ->set('google_optimize_hide_page_external_file', $form_state
    ->getValue('google_optimize_hide_page_external_file'))
    ->save();
  parent::submitForm($form, $form_state);
}