public function BetterSocialSharingButtonsForm::submitForm in Better Social Sharing Buttons 8.3
Same name and namespace in other branches
- 8 src/Form/BetterSocialSharingButtonsForm.php \Drupal\better_social_sharing_buttons\Form\BetterSocialSharingButtonsForm::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/ BetterSocialSharingButtonsForm.php, line 142
Class
- BetterSocialSharingButtonsForm
- Class SettingsForm.
Namespace
Drupal\better_social_sharing_buttons\FormCode
public function submitForm(array &$form, FormStateInterface $form_state) {
$config = $this
->config('better_social_sharing_buttons.settings');
$config
->set('services', $form_state
->getValue('services'));
$config
->set('width', $form_state
->getValue('width'));
$config
->set('radius', $form_state
->getValue('radius'));
$config
->set('facebook_app_id', $form_state
->getValue('facebook_app_id'));
$config
->set('print_css', $form_state
->getValue('print_css'));
$config
->set('iconset', $form_state
->getValue('iconset'));
$config
->set('node_field', $form_state
->getValue('node_field'));
$config
->save();
$this
->messenger()
->addMessage($this
->t("Configuration saved!"));
}