public function PhotoswipeAdminSettings::submitForm in PhotoSwipe 8
Same name and namespace in other branches
- 8.2 src/Form/PhotoswipeAdminSettings.php \Drupal\photoswipe\Form\PhotoswipeAdminSettings::submitForm()
- 3.x src/Form/PhotoswipeAdminSettings.php \Drupal\photoswipe\Form\PhotoswipeAdminSettings::submitForm()
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/ PhotoswipeAdminSettings.php, line 24
Class
Namespace
Drupal\photoswipe\FormCode
public function submitForm(array &$form, FormStateInterface $form_state) {
$config = $this
->config('photoswipe.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);
}