You are here

public function FormtipsSettingForm::submitForm in Form Tips 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/FormtipsSettingForm.php, line 51

Class

FormtipsSettingForm
Configure Form Tips settings for this site.

Namespace

Drupal\formtips\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $config = $this
    ->config('formtips.settings');
  $config_data = $config
    ->getRawData();
  foreach ($config_data as $key => $value) {
    $config
      ->set($key, $form_state
      ->getValue($key));
  }
  $config
    ->save();
  parent::submitForm($form, $form_state);
}