You are here

public function YandexMetricsReportsSettingsForm::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/YandexMetricsReportsSettingsForm.php, line 57
Contains \Drupal\yandex_metrics_reports\Form\YandexMetricsReportsSettingsForm.

Class

YandexMetricsReportsSettingsForm
Provides a reports settings form.

Namespace

Drupal\yandex_metrics_reports\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $reports = yandex_metrics_reports_get_list(TRUE);
  foreach ($reports as $report_name => $report_data) {
    \Drupal::state()
      ->set('yandex_services_reports_' . $report_name . '_visible', $form_state['values'][$report_name . '_visible']);
  }
  parent::submitForm($form, $form_state);
}