You are here

public function MultidomainGoogleAnalyticsAdminSettingsForm::submitForm in Multidomain Google Analytics 8

Same name and namespace in other branches
  1. 8.2 src/Form/MultidomainGoogleAnalyticsAdminSettingsForm.php \Drupal\multidomain_google_analytics\Form\MultidomainGoogleAnalyticsAdminSettingsForm::submitForm()

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/MultidomainGoogleAnalyticsAdminSettingsForm.php, line 114

Class

MultidomainGoogleAnalyticsAdminSettingsForm
Configure Google_Analytics settings for this site.

Namespace

Drupal\multidomain_google_analytics\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $config = $this
    ->config('multidomain_google_analytics.settings');
  $domains = $this->domainLoader
    ->loadOptionsList();
  foreach ($domains as $key => $value) {
    $config
      ->set($key, $form_state
      ->getValue($key))
      ->save();
  }
  parent::submitForm($form, $form_state);
}