public function BatchTestSimpleForm::buildForm in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/system/tests/modules/batch_test/src/Form/BatchTestSimpleForm.php \Drupal\batch_test\Form\BatchTestSimpleForm::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/ BatchTestSimpleForm.php, line 28 - Contains \Drupal\batch_test\Form\BatchTestSimpleForm.
Class
- BatchTestSimpleForm
- Generate form of id batch_test_simple_form.
Namespace
Drupal\batch_test\FormCode
public function buildForm(array $form, FormStateInterface $form_state) {
$form['batch'] = array(
'#type' => 'select',
'#title' => 'Choose batch',
'#options' => array(
'batch_0' => 'batch 0',
'batch_1' => 'batch 1',
'batch_2' => 'batch 2',
'batch_3' => 'batch 3',
'batch_4' => 'batch 4',
),
);
$form['submit'] = array(
'#type' => 'submit',
'#value' => 'Submit',
);
return $form;
}