You are here

public function StaticPreviewForm::submitForm in Tome 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 FormInterface::submitForm

File

modules/tome_static/src/Form/StaticPreviewForm.php, line 75

Class

StaticPreviewForm
Contains a form for initializing a static preview session.

Namespace

Drupal\tome_static\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $this->session
    ->set(StaticPreviewRequestSubscriber::SESSION_KEY, TRUE);
  $form_state
    ->setRedirectUrl(Url::fromUserInput('/'));
}