You are here

public function HeaderForm::submitForm in CookiePro by OneTrust 8

Same name and namespace in other branches
  1. 2.x src/Form/HeaderForm.php \Drupal\cookiepro\Form\HeaderForm::submitForm()

Implements FormBuilder::submitForm().

Serialize the user's settings and save it to the Drupal's config Table.

Overrides ConfigFormBase::submitForm

File

src/Form/HeaderForm.php, line 86

Class

HeaderForm
Provide settings page for adding cookiepro header scripts.

Namespace

Drupal\cookiepro\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $values = $form_state
    ->getValues();
  $this
    ->configFactory()
    ->getEditable('cookiepro.header.settings')
    ->set('scripts', $values['scripts'])
    ->save();
  drupal_set_message($this
    ->t('Your Settings have been saved.'), 'status');
}