You are here

public function VapnConfigForm::submitForm in View access per node 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/VapnConfigForm.php, line 102

Class

VapnConfigForm
Class VapnConfigForm.

Namespace

Drupal\vapn\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  parent::submitForm($form, $form_state);
  $saved = [];
  foreach ($form_state
    ->getValue('vapn_node_list') as $bundle_name => $value) {
    if ($value) {
      $saved[] = $value;
    }
  }
  $this
    ->config('vapn.vapnconfig')
    ->set('vapn_node_list', $saved)
    ->save();
}