You are here

public function PluploadTestForm::buildForm in Plupload integration 2.0.x

Same name and namespace in other branches
  1. 8 plupload_test/src/PluploadTestForm.php \Drupal\plupload_test\PluploadTestForm::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

plupload_test/src/PluploadTestForm.php, line 26

Class

PluploadTestForm
Plupload test form class.

Namespace

Drupal\plupload_test

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $form['plupload'] = [
    '#type' => 'plupload',
    '#title' => 'Plupload',
    '#upload_validators' => [
      'file_validate_extensions' => [
        'zip',
      ],
    ],
  ];
  $form['submit'] = [
    '#type' => 'submit',
    '#value' => $this
      ->t('Submit'),
  ];
  return $form;
}