You are here

public function BatchTestSimpleForm::submitForm in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/system/tests/modules/batch_test/src/Form/BatchTestSimpleForm.php \Drupal\batch_test\Form\BatchTestSimpleForm::submitForm()
  2. 9 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

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);
  foreach ($form_state
    ->getValue('batch') as $batch) {
    $function = '_batch_test_' . $batch;
    batch_set($function());
  }
  $form_state
    ->setRedirect('batch_test.redirect');
}