function BatchTestSimpleForm::submitForm

Same name in other branches
  1. 8.9.x core/modules/system/tests/modules/batch_test/src/Form/BatchTestSimpleForm.php \Drupal\batch_test\Form\BatchTestSimpleForm::submitForm()
  2. 10 core/modules/system/tests/modules/batch_test/src/Form/BatchTestSimpleForm.php \Drupal\batch_test\Form\BatchTestSimpleForm::submitForm()
  3. 11.x 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 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');
}

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