You are here

public function ExampleFormEventSubscribers::alterForm in Hook Event Dispatcher 8

Alter form.

Parameters

\Drupal\hook_event_dispatcher\Event\Form\FormAlterEvent $event: The event.

File

src/Example/ExampleFormEventSubscribers.php, line 33

Class

ExampleFormEventSubscribers
Class ExampleFormEventSubscribers.

Namespace

Drupal\hook_event_dispatcher\Example

Code

public function alterForm(FormAlterEvent $event) {
  $form =& $event
    ->getForm();
  $form['extra_markup'] = [
    '#markup' => 'This is really cool markup',
  ];
}