public function FormTestObject::buildForm in Zircon Profile 8.0
Same name and namespace in other branches
- 8 core/modules/system/tests/modules/form_test/src/FormTestObject.php \Drupal\form_test\FormTestObject::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 ConfigFormBase::buildForm
File
- core/
modules/ system/ tests/ modules/ form_test/ src/ FormTestObject.php, line 35 - Contains \Drupal\form_test\FormTestObject.
Class
- FormTestObject
- Provides a test form object.
Namespace
Drupal\form_testCode
public function buildForm(array $form, FormStateInterface $form_state) {
$form['element'] = array(
'#markup' => 'The FormTestObject::buildForm() method was used for this form.',
);
$form['bananas'] = array(
'#type' => 'textfield',
'#title' => $this
->t('Bananas'),
);
$form['actions']['#type'] = 'actions';
$form['actions']['submit'] = array(
'#type' => 'submit',
'#value' => $this
->t('Save'),
);
$form['#title'] = 'Test dynamic title';
return $form;
}