You are here

public static function ExampleFormEventSubscribers::getSubscribedEvents in Hook Event Dispatcher 3.x

Same name and namespace in other branches
  1. 8.2 examples/ExampleFormEventSubscribers.php \Drupal\hook_event_dispatcher\ExampleFormEventSubscribers::getSubscribedEvents()

File

examples/ExampleFormEventSubscribers.php, line 64

Class

ExampleFormEventSubscribers
Class ExampleFormEventSubscribers.

Namespace

Drupal\hook_event_dispatcher

Code

public static function getSubscribedEvents() : array {
  return [
    HookEventDispatcherInterface::FORM_ALTER => 'alterForm',
    // React on "search_block_form" form.
    'hook_event_dispatcher.form_search_block_form.alter' => 'alterSearchForm',
    // React on al forms with base id "node_form".
    'hook_event_dispatcher.form_base_node_form.alter' => 'alterNodeForm',
  ];
}