public function DropzoneJsTestForm::buildForm in DropzoneJS 8
Same name and namespace in other branches
- 8.2 tests/modules/dropzonejs_test/src/Form/DropzoneJsTestForm.php \Drupal\dropzonejs_test\Form\DropzoneJsTestForm::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
- tests/
modules/ dropzonejs_test/ src/ Form/ DropzoneJsTestForm.php, line 23
Class
- DropzoneJsTestForm
- Class DropzoneJsTestForm.
Namespace
Drupal\dropzonejs_test\FormCode
public function buildForm(array $form, FormStateInterface $form_state) {
$form['dropzonejs'] = [
'#title' => $this
->t('DropzoneJs element'),
'#type' => 'dropzonejs',
'#required' => TRUE,
'#dropzone_description' => 'DropzoneJs description',
'#max_filesize' => '1M',
'#extensions' => 'jpg png',
];
return $form;
}