You are here

public function PetSettingsForm::submitForm in Previewable email templates 8

Same name and namespace in other branches
  1. 8.4 src/Form/PetSettingsForm.php \Drupal\pet\Form\PetSettingsForm::submitForm()
  2. 8.3 src/Form/PetSettingsForm.php \Drupal\pet\Form\PetSettingsForm::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 FormInterface::submitForm

File

src/Form/PetSettingsForm.php, line 25

Class

PetSettingsForm
Class PetSettingsForm. @package Drupal\pet\Form

Namespace

Drupal\pet\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  \Drupal::configFactory()
    ->getEditable('pet.settings')
    ->set('pet_logging', $form_state
    ->getValue('pet_logging'))
    ->save();
}