You are here

public function CustomDataForm::buildForm in Shibboleth Authentication 8

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

src/Form/CustomDataForm.php, line 89

Class

CustomDataForm
Class CustomEmailForm.

Namespace

Drupal\shib_auth\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $form['#cache'] = [
    'max-age' => 0,
  ];
  $form['email'] = [
    '#type' => 'email',
    '#title' => $this
      ->t('Email'),
    '#default_value' => !empty($this->shib_session
      ->getEmail()) ? $this->shib_session
      ->getEmail() : '',
    '#description' => 'Please enter a valid email address.',
  ];
  $form['submit'] = [
    '#type' => 'submit',
    '#value' => $this
      ->t('Submit'),
  ];
  return $form;
}