Hook Event Dispatcher

Component ID

2816261

Component name

Hook Event Dispatcher

Component type

module

Maintenance status

Development status

Component security advisory coverage

covered

Downloads

4026

Component created

Component changed

Component body

This module dispatches events for several Drupal core hooks. This allows you to use the D8 Event Subscriber system, instead of the outdated hook system, to react on certain events. The module includes events for the most common hooks.

Currently this module dispatches events for the following hooks:

  • Block
  • Entity
  • EntityField
  • Form
  • Path
  • Preprocess
  • Token
  • Views

If you want to see new events registered, open an issue in the issue queue and we will try to add it. Hopefully, in the near future, this will be in D8 core...

Examples

The module contains some examples on how to subscribe to certain events.

GitHub

If you prefer to make pull/merge request, when you have a nice addition, instead of creating a patch, you can do that on GitHub.