You are here

public function PwaExtrasSettingsForm::submitForm in Progressive Web App 8

Same name and namespace in other branches
  1. 2.x modules/pwa_extras/src/Form/PwaExtrasSettingsForm.php \Drupal\pwa_extras\Form\PwaExtrasSettingsForm::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

modules/pwa_extras/src/Form/PwaExtrasSettingsForm.php, line 97

Class

PwaExtrasSettingsForm
PWA Extras admin settings form.

Namespace

Drupal\pwa_extras\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $config = $this
    ->config('pwa_extras.settings.apple');
  $values = $form_state
    ->getValues();
  $config
    ->set('touch_icons', $values['touch_icons'])
    ->set('mask_color', $values['mask_color'])
    ->set('meta_tags', $values['meta_tags'])
    ->set('color_select', $values['color_select'])
    ->set('home_screen_icons', $values['home_screen_icons'])
    ->save();
  parent::submitForm($form, $form_state);
}