public function FooterForm::submitForm in Header and Footer Scripts 8
Same name and namespace in other branches
- 8.2 src/Form/FooterForm.php \Drupal\header_and_footer_scripts\Form\FooterForm::submitForm()
Implements FormBuilder::submitForm().
Serialize the user's settings and save it to the Drupal's config Table.
Overrides ConfigFormBase::submitForm
File
- src/
Form/ FooterForm.php, line 64
Class
- FooterForm
- Provide settings page for adding CSS/JS before the end 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.footer.settings')
->set('styles', $values['styles'])
->set('scripts', $values['scripts'])
->save();
drupal_set_message($this
->t('Your Settings have been saved.'), 'status');
}