You are here

public function IpBanAdmin::submitForm in IP Ban 8

Same name in this branch
  1. 8 src/IpBanAdmin.php \Drupal\ip_ban\IpBanAdmin::submitForm()
  2. 8 src/Form/IpBanAdmin.php \Drupal\ip_ban\Form\IpBanAdmin::submitForm()

File

src/IpBanAdmin.php, line 16

Class

IpBanAdmin

Namespace

Drupal\ip_ban

Code

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