function StatisticsSettingsForm::submitForm
Same name in other branches
- 9 core/modules/statistics/src/StatisticsSettingsForm.php \Drupal\statistics\StatisticsSettingsForm::submitForm()
- 10 core/modules/statistics/src/StatisticsSettingsForm.php \Drupal\statistics\StatisticsSettingsForm::submitForm()
- 11.x core/modules/statistics/src/StatisticsSettingsForm.php \Drupal\statistics\StatisticsSettingsForm::submitForm()
Overrides ConfigFormBase::submitForm
File
-
core/
modules/ statistics/ src/ StatisticsSettingsForm.php, line 88
Class
- StatisticsSettingsForm
- Configure statistics settings for this site.
Namespace
Drupal\statisticsCode
public function submitForm(array &$form, FormStateInterface $form_state) {
$this->config('statistics.settings')
->set('count_content_views', $form_state->getValue('statistics_count_content_views'))
->save();
// The popular statistics block is dependent on these settings, so clear the
// block plugin definitions cache.
if ($this->moduleHandler
->moduleExists('block')) {
\Drupal::service('plugin.manager.block')->clearCachedDefinitions();
}
parent::submitForm($form, $form_state);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.