You are here

public function SettingsForm::submitForm in Config Export Ignore 8

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/SettingsForm.php, line 48

Class

SettingsForm
Class SettingsForm.

Namespace

Drupal\config_export_ignore\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  parent::submitForm($form, $form_state);
  $values = $form_state
    ->getValues();
  $config_ignore_settings = $this
    ->config('config_export_ignore.settings');
  $config_ignore_settings_array = preg_split("[\n|\r]", $values['configuration_names']);
  $config_ignore_settings_array = array_filter($config_ignore_settings_array);
  $config_ignore_settings
    ->set('configuration_names', $config_ignore_settings_array);
  $config_ignore_settings
    ->save();
}