You are here

public function InviteWithdrawForm::buildForm in Invite 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/InviteWithdrawForm.php, line 81

Class

InviteWithdrawForm
Class InviteWithdrawForm.

Namespace

Drupal\invite\Form

Code

public function buildForm(array $form, FormStateInterface $form_state, InviteInterface $invite = NULL) {

  /** @var \Drupal\invite\InviteInterface $invite */
  $form['#title'] = $this
    ->t('Withdraw invite for @field_invite_email_address', [
    '@field_invite_email_address' => $invite->field_invite_email_address->value,
  ]);
  $this->inviteStorage = $invite;
  $form['actions']['#type'] = 'actions';
  $form['withdraw_invite'] = [
    '#type' => 'submit',
    '#title' => $this
      ->t('Withdraw Invite'),
    '#description' => $this
      ->t('Withdraw current invite.'),
    '#button_type' => 'primary',
    '#value' => $this
      ->t('Withdraw Invite'),
  ];
  return $form;
}