You are here

public function SettingsForm::submitForm in oEmbed 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

src/Form/SettingsForm.php, line 74
Contains \Drupal\oembed\Form\SettingsForm.

Class

SettingsForm

Namespace

Drupal\oembed\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  parent::submitForm($form, $form_state);
  $this
    ->config('oembed.settings')
    ->set('cache.lifetime', $form_state
    ->getValue([
    'cache',
    'lifetime',
  ]))
    ->set('cache.flush', $form_state
    ->getValue([
    'cache',
    'flush',
  ]))
    ->save();
}