You are here

public function BatchTestChainedForm::buildForm in Zircon Profile 8

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

Form constructor.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Return value

array The form structure.

Overrides FormInterface::buildForm

File

core/modules/system/tests/modules/batch_test/src/Form/BatchTestChainedForm.php, line 28
Contains \Drupal\batch_test\Form\BatchTestChainedForm.

Class

BatchTestChainedForm
Generate form of id batch_test_chained_form.

Namespace

Drupal\batch_test\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {

  // This value is used to test that $form_state persists through batched
  // submit handlers.
  $form['value'] = array(
    '#type' => 'textfield',
    '#title' => 'Value',
    '#default_value' => 1,
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => 'Submit',
  );
  $form['#submit'] = array(
    'Drupal\\batch_test\\Form\\BatchTestChainedForm::batchTestChainedFormSubmit1',
    'Drupal\\batch_test\\Form\\BatchTestChainedForm::batchTestChainedFormSubmit2',
    'Drupal\\batch_test\\Form\\BatchTestChainedForm::batchTestChainedFormSubmit3',
    'Drupal\\batch_test\\Form\\BatchTestChainedForm::batchTestChainedFormSubmit4',
  );
  return $form;
}