You are here

public function styledGoogleMapSettingsForm::submitForm in Styled Google Map 8

Same name and namespace in other branches
  1. 8.2 src/Form/StyledGoogleMapSettingsForm.php \Drupal\styled_google_map\Form\StyledGoogleMapSettingsForm::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

src/Form/styledGoogleMapSettingsForm.php, line 79

Class

styledGoogleMapSettingsForm
Configure example settings for this site.

Namespace

Drupal\styled_google_map\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $config = \Drupal::service('config.factory')
    ->getEditable('styled_google_map.settings');
  $config
    ->set('styled_google_map_google_auth_method', $form_state
    ->getValue('styled_google_map_google_auth_method'))
    ->set('styled_google_map_google_apikey', $form_state
    ->getValue('styled_google_map_google_apikey'))
    ->set('styled_google_map_google_client_id', $form_state
    ->getValue('styled_google_map_google_client_id'))
    ->save();
  parent::submitForm($form, $form_state);
}