You are here

public function WorkbenchSettingsForm::submitForm in Workbench 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/WorkbenchSettingsForm.php, line 56
Settings form for Workbench module.

Class

WorkbenchSettingsForm
Generates the Workbench configuration form.

Namespace

Drupal\workbench\Form

Code

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