You are here

function batch_example_simple_form_submit in Examples for Developers 7

Same name and namespace in other branches
  1. 6 batch_example/batch_example.module \batch_example_simple_form_submit()

Submit handler.

Parameters

array $form: Form API form.

array $form_state: Form API form.

Related topics

File

batch_example/batch_example.module, line 85
Outlines how a module can use the Batch API.

Code

function batch_example_simple_form_submit($form, &$form_state) {
  $function = 'batch_example_' . $form_state['values']['batch'];

  // Reset counter for debug information.
  $_SESSION['http_request_count'] = 0;

  // Execute the function named batch_example_batch_1() or
  // batch_example_batch_2().
  $batch = $function();
  batch_set($batch);
}