function FileTestForm::buildForm

Same name in other branches
  1. 9 core/modules/file/tests/file_test/src/Form/FileTestForm.php \Drupal\file_test\Form\FileTestForm::buildForm()
  2. 8.9.x core/modules/file/tests/file_test/src/Form/FileTestForm.php \Drupal\file_test\Form\FileTestForm::buildForm()
  3. 10 core/modules/file/tests/file_test/src/Form/FileTestForm.php \Drupal\file_test\Form\FileTestForm::buildForm()

Overrides FormInterface::buildForm

1 call to FileTestForm::buildForm()
FileRequiredTestForm::buildForm in core/modules/file/tests/file_test/src/Form/FileRequiredTestForm.php
Form constructor.
1 method overrides FileTestForm::buildForm()
FileRequiredTestForm::buildForm in core/modules/file/tests/file_test/src/Form/FileRequiredTestForm.php
Form constructor.

File

core/modules/file/tests/file_test/src/Form/FileTestForm.php, line 30

Class

FileTestForm
File test form class.

Namespace

Drupal\file_test\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
    $form = $this->baseForm($form, $form_state);
    $form['file_test_upload'] = [
        '#type' => 'file',
        '#title' => $this->t('Upload a file'),
    ];
    return $form;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.