You are here

public function AddToHomescreenForm::submitForm in Add to homescreen 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/AddToHomescreenForm.php, line 147

Class

AddToHomescreenForm
Configure Add to Homescreen.

Namespace

Drupal\addtohomescreen\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $this
    ->config('addtohomescreen.settings')
    ->set('debug', $form_state
    ->getValue('debug'))
    ->set('modal', $form_state
    ->getValue('modal'))
    ->set('mandatory', $form_state
    ->getValue('mandatory'))
    ->set('skipfirstvisit', $form_state
    ->getValue('skipfirstvisit'))
    ->set('autostart', $form_state
    ->getValue('autostart'))
    ->set('icon', $form_state
    ->getValue('icon'))
    ->set('startdelay', $form_state
    ->getValue('startdelay'))
    ->set('lifespan', $form_state
    ->getValue('lifespan'))
    ->set('displaypace', $form_state
    ->getValue('displaypace'))
    ->set('maxdisplaycount', $form_state
    ->getValue('maxdisplaycount'))
    ->set('use_custom_message', $form_state
    ->getValue('use_custom_message'))
    ->set('message', $form_state
    ->getValue('message'))
    ->set('compression_type', $form_state
    ->getValue('compression_type'))
    ->save();
  parent::submitForm($form, $form_state);
}