You are here

public function Lightbox2IframeSettingsForm::submitForm in Lightbox2 8

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

File

src/Lightbox2IframeSettingsForm.php, line 16

Class

Lightbox2IframeSettingsForm

Namespace

Drupal\lightbox2

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $config = $this
    ->config('lightbox2.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);
}