You are here

public function HealthCheckSettingsForm::submitForm in Health Check Url 8

Same name and namespace in other branches
  1. 8.3 src/Form/HealthCheckSettingsForm.php \Drupal\health_check_url\Form\HealthCheckSettingsForm::submitForm()
  2. 8.2 src/Form/HealthCheckSettingsForm.php \Drupal\health_check_url\Form\HealthCheckSettingsForm::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/HealthCheckSettingsForm.php, line 91

Class

HealthCheckSettingsForm
Configure health settings for this site.

Namespace

Drupal\health_check_url\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $this
    ->config('health_check_url.settings')
    ->set('type', $form_state
    ->getValue('type'))
    ->set('string', $form_state
    ->getValue('string'))
    ->set('endpoint', $form_state
    ->getValue('endpoint'))
    ->set('maintainence_access', $form_state
    ->getValue('maintainence_access'))
    ->save();
  \Drupal::service("router.builder")
    ->rebuild();
  parent::submitForm($form, $form_state);
}