You are here

public function PhotosAccessPasswordForm::buildForm in Album Photos 8.5

Same name and namespace in other branches
  1. 8.4 photos_access/src/Form/PhotosAccessPasswordForm.php \Drupal\photos_access\Form\PhotosAccessPasswordForm::buildForm()
  2. 6.0.x photos_access/src/Form/PhotosAccessPasswordForm.php \Drupal\photos_access\Form\PhotosAccessPasswordForm::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

photos_access/src/Form/PhotosAccessPasswordForm.php, line 55

Class

PhotosAccessPasswordForm
Defines a form to upload photos to this site.

Namespace

Drupal\photos_access\Form

Code

public function buildForm(array $form, FormStateInterface $form_state, $node = NULL) {
  $form['pass'] = [
    '#type' => 'password',
    '#title' => $this
      ->t('Please enter album password'),
    '#attributes' => [
      'autocomplete' => 'off',
    ],
  ];
  $form['nid'] = [
    '#type' => 'value',
    '#value' => $node
      ->id(),
  ];
  $form['submit'] = [
    '#type' => 'submit',
    '#value' => $this
      ->t('Submit'),
  ];
  return $form;
}