You are here

public function WebhookForm::submitForm in Fastly 8.3

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/WebhookForm.php, line 119

Class

WebhookForm
Class WebhookForm.

Namespace

Drupal\fastly\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $this
    ->config('fastly.settings')
    ->set('webhook_url', $form_state
    ->getValue('webhook_url'))
    ->set('webhook_enabled', $form_state
    ->getValue('webhook_enabled'))
    ->set('webhook_notifications', $form_state
    ->getValue('webhook_notifications'))
    ->save();
  $this->webhook
    ->sendWebHook($this
    ->t("Fastly module configuration changed on %base_url", [
    '%base_url' => $this->baseUrl,
  ]), "config_save");
  parent::submitForm($form, $form_state);
}