You are here

public function HttpsWwwSettingsForm::submitForm in HTTPS and WWW Redirect 8

Same name and namespace in other branches
  1. 2.x src/Form/HttpsWwwSettingsForm.php \Drupal\httpswww\Form\HttpsWwwSettingsForm::submitForm()

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/HttpsWwwSettingsForm.php, line 92

Class

HttpsWwwSettingsForm
Class HttpsWwwSettingsForm.

Namespace

Drupal\httpswww\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $config = $this
    ->config('httpswww.settings');
  $config
    ->set('enabled', $form_state
    ->getValue('enabled'));
  $config
    ->set('prefix', $form_state
    ->getValue('prefix'));
  $config
    ->set('scheme', $form_state
    ->getValue('scheme'));
  $config
    ->save();
  $this
    ->messenger()
    ->addStatus($this
    ->t('The configuration options have been saved.'));
}