You are here

public function MauticAdminSettingsForm::submitForm in Mautic Integration 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/MauticAdminSettingsForm.php, line 159

Class

MauticAdminSettingsForm
Configure Mautic settings for this site.

Namespace

Drupal\mautic\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $config = $this
    ->config('mautic.settings');
  $config
    ->set('mautic_enable', $form_state
    ->getValue('mautic_enable'))
    ->set('mautic_base_url', $form_state
    ->getValue('mautic_base_url'))
    ->set('visibility.request_path_mode', $form_state
    ->getValue('mautic_visibility_request_path_mode'))
    ->set('visibility.request_path_pages', $form_state
    ->getValue('mautic_visibility_request_path_pages'))
    ->set('header', $form_state
    ->getValue('header'))
    ->set('lift_enable', $form_state
    ->getValue('lift_enable'))
    ->save();
  parent::submitForm($form, $form_state);
}