You are here

public function WishlistEmailForm::buildForm in UC Wish List 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/WishlistEmailForm.php, line 23

Class

WishlistEmailForm

Namespace

Drupal\uc_wishlist\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $form['subject'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('Subject'),
    '#required' => TRUE,
    '#description' => $this
      ->t('Enter Email Subject.'),
  ];
  $form['recipients'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('Recipients'),
    '#required' => TRUE,
    '#description' => $this
      ->t('Email address of the reciepient. Seperate recipients using a comma.'),
  ];
  $form['message'] = [
    '#type' => 'textarea',
    '#title' => $this
      ->t('Message'),
    '#rows' => 6,
    '#required' => TRUE,
    '#description' => $this
      ->t('Enter Email Message.'),
  ];
  $form['actions']['#type'] = 'actions';
  $form['actions']['submit'] = [
    '#type' => 'submit',
    '#value' => $this
      ->t('Send'),
    '#button_type' => 'primary',
  ];
  return $form;
}