You are here

public function WundergroundWeatherSettingsForm::submitForm in Wunderground weather 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/WundergroundWeatherSettingsForm.php, line 123
Contains \Drupal\wunderground_weather\Form\wunderground_weatherSettingsForm.

Class

WundergroundWeatherSettingsForm
Defines a form to configure module settings.

Namespace

Drupal\wunderground_weather\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $this->configFactory
    ->getEditable('wunderground_weather.settings')
    ->set('api_key', $form_state
    ->getValue('api_key'))
    ->set('language', $form_state
    ->getValue('language'))
    ->save();
  parent::submitForm($form, $form_state);
}