You are here

public function AdminSettingForm::submitForm in Restrict Abusive Words 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/AdminSettingForm.php, line 118
Contains \Drupal\restrict_abusive_words\Form\AdminSettingForm.

Class

AdminSettingForm
Contribute form.

Namespace

Drupal\restrict_abusive_words\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $config = \Drupal::service('config.factory')
    ->getEditable('restrict_abusive_words.settings');
  $config
    ->set('action_type', $form_state
    ->getValue('action_type'))
    ->set('disable_user_roles', $form_state
    ->getValue('disable_user_roles'))
    ->set('enable_user_roles', $form_state
    ->getValue('enable_user_roles'))
    ->set('general_form', $form_state
    ->getValue('general_form'))
    ->set('entity_node', $form_state
    ->getValue('entity_node'))
    ->set('entity_comment', $form_state
    ->getValue('entity_comment'))
    ->save();
  parent::submitForm($form, $form_state);
}