function SettingsForm::submitForm

Same name in this branch
  1. 8.9.x core/modules/media_library/src/Form/SettingsForm.php \Drupal\media_library\Form\SettingsForm::submitForm()
Same name in other branches
  1. 9 core/modules/media_library/src/Form/SettingsForm.php \Drupal\media_library\Form\SettingsForm::submitForm()
  2. 9 core/modules/aggregator/src/Form/SettingsForm.php \Drupal\aggregator\Form\SettingsForm::submitForm()
  3. 10 core/modules/media_library/src/Form/SettingsForm.php \Drupal\media_library\Form\SettingsForm::submitForm()
  4. 11.x core/modules/media_library/src/Form/SettingsForm.php \Drupal\media_library\Form\SettingsForm::submitForm()
  5. 11.x core/modules/navigation/src/Form/SettingsForm.php \Drupal\navigation\Form\SettingsForm::submitForm()
  6. 10 core/modules/navigation/src/Form/SettingsForm.php \Drupal\navigation\Form\SettingsForm::submitForm()

Overrides ConfigFormBase::submitForm

File

core/modules/aggregator/src/Form/SettingsForm.php, line 206

Class

SettingsForm
Configures aggregator settings for this site.

Namespace

Drupal\aggregator\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
    parent::submitForm($form, $form_state);
    $config = $this->config('aggregator.settings');
    // Let active plugins save their settings.
    foreach ($this->configurableInstances as $instance) {
        $instance->submitConfigurationForm($form, $form_state);
    }
    $config->set('items.allowed_html', $form_state->getValue('aggregator_allowed_html_tags'));
    if ($form_state->hasValue('aggregator_fetcher')) {
        $config->set('fetcher', $form_state->getValue('aggregator_fetcher'));
    }
    if ($form_state->hasValue('aggregator_parser')) {
        $config->set('parser', $form_state->getValue('aggregator_parser'));
    }
    if ($form_state->hasValue('aggregator_processors')) {
        $config->set('processors', array_filter($form_state->getValue('aggregator_processors')));
    }
    $config->save();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.