public function StatisticsSettingsForm::submitForm

Implements \Drupal\Core\Form\FormInterface::submitForm().

Overrides SystemConfigFormBase::submitForm

File

drupal/core/modules/statistics/lib/Drupal/statistics/StatisticsSettingsForm.php, line 80
Contains \Drupal\statistics\StatisticsSettingsForm.

Class

StatisticsSettingsForm
Configure statistics settings for this site.

Namespace

Drupal\statistics

Code

public function submitForm(array &$form, array &$form_state) {
  $this->configFactory
    ->get('statistics.settings')
    ->set('count_content_views', $form_state['values']['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_container()
      ->get('plugin.manager.block')
      ->clearCachedDefinitions();
  }
  parent::submitForm($form, $form_state);
}