function BatchTestSimpleForm::buildForm
Same name in other branches
- 8.9.x core/modules/system/tests/modules/batch_test/src/Form/BatchTestSimpleForm.php \Drupal\batch_test\Form\BatchTestSimpleForm::buildForm()
- 10 core/modules/system/tests/modules/batch_test/src/Form/BatchTestSimpleForm.php \Drupal\batch_test\Form\BatchTestSimpleForm::buildForm()
- 11.x core/modules/system/tests/modules/batch_test/src/Form/BatchTestSimpleForm.php \Drupal\batch_test\Form\BatchTestSimpleForm::buildForm()
Overrides FormInterface::buildForm
File
-
core/
modules/ system/ tests/ modules/ batch_test/ src/ Form/ BatchTestSimpleForm.php, line 25
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'] = [
'#type' => 'select',
'#title' => 'Choose batch',
'#options' => [
'batch_0' => 'batch 0',
'batch_1' => 'batch 1',
'batch_2' => 'batch 2',
'batch_3' => 'batch 3',
'batch_4' => 'batch 4',
'batch_6' => 'batch 6',
'batch_7' => 'batch 7',
],
'#multiple' => TRUE,
];
$form['submit'] = [
'#type' => 'submit',
'#value' => 'Submit',
];
return $form;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.