You are here

public function RequestHashForm::buildForm in Simplenews 8.2

Same name and namespace in other branches
  1. 8 src/Form/RequestHashForm.php \Drupal\simplenews\Form\RequestHashForm::buildForm()
  2. 3.x src/Form/RequestHashForm.php \Drupal\simplenews\Form\RequestHashForm::buildForm()

Request new hash form.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

string $key: The mail key to be sent.

array $context: Necessary context to send the mail. Must at least include the simplenews subscriber.

Return value

array The form structure.

Overrides ConfirmFormBase::buildForm

File

src/Form/RequestHashForm.php, line 65

Class

RequestHashForm
Provides an generic base class for a confirmation form.

Namespace

Drupal\simplenews\Form

Code

public function buildForm(array $form, FormStateInterface $form_state, $key = '', array $context = []) {
  $form = parent::buildForm($form, $form_state);
  $form_state
    ->set('key', $key);
  $form_state
    ->set('context', $context);
  return $form;
}