You are here

public function AdsenseOldCodeSettings::submitForm in Google AdSense integration 8

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

oldcode/src/Form/AdsenseOldCodeSettings.php, line 181

Class

AdsenseOldCodeSettings
Form for the older adsense content ads settings.

Namespace

Drupal\adsense_oldcode\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $config = $this
    ->configFactory()
    ->getEditable('adsense_oldcode.settings');
  $form_state
    ->cleanValues();
  foreach ($form_state
    ->getValues() as $key => $value) {
    $config
      ->set($key, Html::escape($value));
  }
  $config
    ->save();
  parent::submitForm($form, $form_state);
}