function DispatchForm::buildForm

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

tests/modules/rules_test_event/src/Form/DispatchForm.php, line 54

Class

DispatchForm
Acquires input, wraps it in a Task object, and queues it for processing.

Namespace

Drupal\rules_test_event\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $form['event'] = [
    '#type' => 'radios',
    '#options' => [
      0 => $this->t('PlainEvent'),
      1 => $this->t('GenericEvent'),
      2 => $this->t('GetterEvent'),
    ],
    '#description' => $this->t('Choose Event to dispatch for testing.'),
  ];
  $form['submit'] = [
    '#type' => 'submit',
    '#value' => 'Dispatch event',
  ];
  return $form;
}