function 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.