You are here

public function SettingsForm::submitForm in Block Blacklist [Deprecated] 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 182

Class

SettingsForm
Class BlockBlacklistSettings.

Namespace

Drupal\block_blacklist\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  parent::submitForm($form, $form_state);
  $settings = $this
    ->config('block_blacklist.settings');
  $settings
    ->set('system_match', $form_state
    ->getValue('system_match'));
  $settings
    ->set('system_prefix', $form_state
    ->getValue('system_prefix'));
  $settings
    ->set('system_regex', $form_state
    ->getValue('system_regex'));
  $settings
    ->set('layout_match', $form_state
    ->getValue('layout_match'));
  $settings
    ->set('layout_prefix', $form_state
    ->getValue('layout_prefix'));
  $settings
    ->set('layout_regex', $form_state
    ->getValue('layout_regex'));
  $settings
    ->save();

  // Flush caches to be sure the system block list gets updated.
  drupal_flush_all_caches();
}