You are here

public function CounterSettingsInitial::submitForm in Counter 8

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/CounterSettingsInitial.php, line 84

Class

CounterSettingsInitial
Class AddForm.

Namespace

Drupal\counter\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  parent::submitForm($form, $form_state);
  $this
    ->config('counter.settings')
    ->set('counter_initial_counter', $form_state
    ->getValue('counter_initial_counter'))
    ->set('counter_initial_unique_visitor', $form_state
    ->getValue('counter_initial_unique_visitor'))
    ->set('counter_initial_since', $form_state
    ->getValue('counter_initial_since'))
    ->save();
}