You are here

public function BatchTestSimpleForm::submitForm in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/system/tests/modules/batch_test/src/Form/BatchTestSimpleForm.php \Drupal\batch_test\Form\BatchTestSimpleForm::submitForm()

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

core/modules/system/tests/modules/batch_test/src/Form/BatchTestSimpleForm.php, line 51
Contains \Drupal\batch_test\Form\BatchTestSimpleForm.

Class

BatchTestSimpleForm
Generate form of id batch_test_simple_form.

Namespace

Drupal\batch_test\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  batch_test_stack(NULL, TRUE);
  $function = '_batch_test_' . $form_state
    ->getValue('batch');
  batch_set($function());
  $form_state
    ->setRedirect('batch_test.redirect');
}