You are here

public function CommentNotifyUnsubscribe::buildForm in Comment Notify 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/CommentNotifyUnsubscribe.php, line 51

Class

CommentNotifyUnsubscribe
Unsubscribe form for Comment Notify.

Namespace

Drupal\comment_notify\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $form['comment_notify_unsubscribe'] = [];
  $form['comment_notify_unsubscribe']['email'] = [
    '#type' => 'textfield',
    '#title' => t('Email to unsubscribe'),
    '#description' => $this
      ->t('All comment notification requests associated with this email will be revoked.'),
    '#required' => TRUE,
  ];
  $form['comment_notify_unsubscribe']['submit'] = [
    '#type' => 'submit',
    '#value' => t('Unsubscribe this e-mail'),
  ];
  return $form;
}