You are here

public function DemoDumpForm::submitForm in Demonstration site (Sandbox / Snapshot) 8

create the database.

Overrides FormInterface::submitForm

File

src/Form/DemoDumpForm.php, line 74

Class

DemoDumpForm

Namespace

Drupal\demo\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  if ($fileconfig = _demo_dump($form_state
    ->getValue([
    'dump',
  ]))) {
    \Drupal::messenger()
      ->addMessage(t('Snapshot %filename has been created.', [
      '%filename' => $form_state
        ->getValue([
        'dump',
        'filename',
      ]),
    ]));
  }
  $form_state
    ->setRedirect('demo.manage_form');
}