You are here

public function ExternalAdminSettings::submitForm in External New Tab 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/ExternalAdminSettings.php, line 86
Contains \Drupal\external\Form\ExternalAdminSettings.

Class

ExternalAdminSettings

Namespace

Drupal\external\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $config = $this
    ->config('external.settings');
  $config
    ->set('external_enabled', $form_state
    ->getValue('external_enabled'));
  $config
    ->set('external_docs_enabled', $form_state
    ->getValue('external_docs_enabled'));
  $config
    ->set('external_disabled_patterns', $form_state
    ->getValue('external_disabled_patterns'));
  $config
    ->save();
  parent::submitForm($form, $form_state);
}