public function BodyForm::submitForm in Header and Footer Scripts 8
Same name and namespace in other branches
- 8.2 src/Form/BodyForm.php \Drupal\header_and_footer_scripts\Form\BodyForm::submitForm()
Implements FormBuilder::submitForm().
Serialize the user's settings and save it to the Drupal's config Table.
Overrides ConfigFormBase::submitForm
File
- src/
Form/ BodyForm.php, line 64
Class
- BodyForm
- Provide settings page for adding CSS/JS after the start of body tag.
Namespace
Drupal\header_and_footer_scripts\FormCode
public function submitForm(array &$form, FormStateInterface $form_state) {
$values = $form_state
->getValues();
$this
->configFactory()
->getEditable('header_and_footer_scripts.body.settings')
->set('styles', $values['styles'])
->set('scripts', $values['scripts'])
->save();
drupal_set_message($this
->t('Your Settings have been saved.'), 'status');
}