You are here

public function ColorizedGmapConfigurationForm::submitForm in Colorized google maps block 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/ColorizedGmapConfigurationForm.php, line 126

Class

ColorizedGmapConfigurationForm
Defines a form that configures forms module settings.

Namespace

Drupal\colorized_gmap\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $values = $form_state
    ->getValues();
  $this
    ->config('colorized_gmap.settings')
    ->set('colorized_gmap_auth_method', $values['colorized_gmap_auth_method'])
    ->save();
  $this
    ->config('colorized_gmap.settings')
    ->set('colorized_gmap_api_key', $values['colorized_gmap_api_key'])
    ->save();
  $this
    ->config('colorized_gmap.settings')
    ->set('colorized_gmap_client_id', $values['colorized_gmap_client_id'])
    ->save();
  $this
    ->config('colorized_gmap.settings')
    ->set('colorized_gmap_private_key', $values['colorized_gmap_private_key'])
    ->save();
  $this
    ->messenger()
    ->addMessage('Settings are saved');
}