function BatchTestSimpleForm::submitForm

Same name and namespace in other branches
  1. 9 core/modules/system/tests/modules/batch_test/src/Form/BatchTestSimpleForm.php \Drupal\batch_test\Form\BatchTestSimpleForm::submitForm()
  2. 8.9.x core/modules/system/tests/modules/batch_test/src/Form/BatchTestSimpleForm.php \Drupal\batch_test\Form\BatchTestSimpleForm::submitForm()
  3. 10 core/modules/system/tests/modules/batch_test/src/Form/BatchTestSimpleForm.php \Drupal\batch_test\Form\BatchTestSimpleForm::submitForm()

Overrides FormInterface::submitForm

File

core/modules/system/tests/modules/batch_test/src/Form/BatchTestSimpleForm.php, line 52

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');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.