You are here

public function SettingsForm::submitForm in Leaflet MapBox 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/SettingsForm.php, line 99

Class

SettingsForm

Namespace

Drupal\leaflet_mapbox\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  parent::submitForm($form, $form_state);
  $values = $form_state
    ->getValues();
  $this
    ->config('leaflet_mapbox.settings')
    ->set('label', $values['label'])
    ->set('api_version', $values['api_version'])
    ->set('code', $values['code'])
    ->set('style_url', $values['style_url'])
    ->set('token', $values['token'])
    ->set('zoomlevel', $values['zoomlevel'])
    ->set('description', $values['description'])
    ->save();
}