function FileRequiredTestForm::buildForm

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

Overrides FileTestForm::buildForm

File

core/modules/file/tests/file_test/src/Form/FileRequiredTestForm.php, line 24

Class

FileRequiredTestForm
File required test form class.

Namespace

Drupal\file_test\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
    $form = parent::buildForm($form, $form_state);
    $form['file_test_upload']['#required'] = TRUE;
    return $form;
}

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