You are here

public function YandexMetricsReportsCronForm::submitForm in Yandex.Metrics 8.2

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

yandex_metrics_reports/src/Form/YandexMetricsReportsCronForm.php, line 63
Contains \Drupal\yandex_metrics_reports\Form\YandexMetricsReportsCronForm.

Class

YandexMetricsReportsCronForm
Provides a cron settings form.

Namespace

Drupal\yandex_metrics_reports\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $config = $this->configFactory
    ->get('yandex_metrics_reports.settings');
  $config
    ->set('popular_content_date_period', $form_state['values']['date_period'])
    ->save();
  parent::submitForm($form, $form_state);
}