You are here

public function Settings::submitForm in jQuery World Calendars API 3.x

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/Settings.php, line 29
Contains \Drupal\jquery_calendar\Form\JqueryCalendarSettings.

Class

Settings

Namespace

Drupal\jquery_calendar\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $config = $this
    ->config('jquery_calendar.settings');
  foreach (Element::children($form) as $variable) {
    $config
      ->set($variable, $form_state
      ->getValue($form[$variable]['#parents']));
  }
  $config
    ->save();
  drupal_flush_all_caches();
  parent::submitForm($form, $form_state);
}