public function BaiduMapsSettings::submitForm in Geolocation Field 8.3
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_baidu/ src/ Form/ BaiduMapsSettings.php, line 50
Class
- BaiduMapsSettings
- Implements the Baidu Maps form controller.
Namespace
Drupal\geolocation_baidu\FormCode
public function submitForm(array &$form, FormStateInterface $form_state) {
$config = $this
->configFactory()
->getEditable('baidu_maps.settings');
$config
->set('key', $form_state
->getValue('key'));
$config
->save();
// Confirmation on form submission.
\Drupal::messenger()
->addMessage($this
->t('The configuration options have been saved.'));
drupal_flush_all_caches();
}