public function MultidomainGoogleAnalyticsAdminSettingsForm::submitForm in Multidomain Google Analytics 8.2
Same name and namespace in other branches
- 8 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 115
Class
- MultidomainGoogleAnalyticsAdminSettingsForm
- Configure Google_Analytics settings for this site.
Namespace
Drupal\multidomain_google_analytics\FormCode
public function submitForm(array &$form, FormStateInterface $form_state) {
$config = $this
->config('multidomain_google_analytics.settings');
$domains = $this->entityTypeManager
->getStorage('domain')
->loadMultiple();
foreach ($domains as $key => $value) {
$config
->set($key, $form_state
->getValue($key))
->save();
}
parent::submitForm($form, $form_state);
}