You are here

public function DemoResetConfirm::submitForm in Demonstration site (Sandbox / Snapshot) 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

src/Form/DemoResetConfirm.php, line 47

Class

DemoResetConfirm
Returns demo_reset_confirm from to make sure that you really want to reset the configuration.

Namespace

Drupal\demo\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {

  // Reset site to chosen snapshot.
  _demo_reset($form_state
    ->getValue([
    'filename',
  ]));

  // Do not redirect from the reset confirmation form by default, as it is
  // likely that the user wants to reset all over again (e.g., keeping the
  // browser tab open).
}