You are here

public function SettingsForm::submitForm in Access unpublished 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 89

Class

SettingsForm
Configure access unpublished settings for this site.

Namespace

Drupal\access_unpublished\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  parent::submitForm($form, $form_state);
  $this
    ->config('access_unpublished.settings')
    ->set('hash_key', $form_state
    ->getValue('hash_key'))
    ->set('duration', $form_state
    ->getValue('duration'))
    ->set('cleanup_expired_tokens', $form_state
    ->getValue('cleanup_expired_tokens'))
    ->set('cleanup_expired_tokens_period', $form_state
    ->getValue('cleanup_expired_tokens_period'))
    ->set('modify_http_headers', $form_state
    ->getValue('modify_http_headers'))
    ->save();
}