public function YandexMapsSettings::submitForm in Geolocation Field 8.3
Same name and namespace in other branches
- 8.2 modules/geolocation_yandex/src/Form/YandexMapsSettings.php \Drupal\geolocation_yandex\Form\YandexMapsSettings::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/
geolocation_yandex/ src/ Form/ YandexMapsSettings.php, line 60
Class
- YandexMapsSettings
- Implements the Yandex Maps form controller.
Namespace
Drupal\geolocation_yandex\FormCode
public function submitForm(array &$form, FormStateInterface $form_state) {
$config = $this
->configFactory()
->getEditable('geolocation_yandex.settings');
$config
->set('api_key', $form_state
->getValue('api_key'));
$config
->set('packages', array_filter(array_values($form_state
->getValue('packages'))));
$config
->save();
// Confirmation on form submission.
\Drupal::messenger()
->addMessage($this
->t('The configuration options have been saved.'));
drupal_flush_all_caches();
}