Tags

This is the first in series of articles about the new hook system in Drupal. Let's start with a simple timeline of what each version provides!

11.1

OOP hooks are available!

Hooks can be defined in classes with the #[Hook] attribute.

Almost all hooks in .module files are supported!

Exceptions that must remain procedural

  • hook_module_implements_alter
  • hook_hook_info
  • hook_preprocess
  • hooks_preprocess_HOOK
  • template_preprocess_HOOK
  • hooks required to be in the .install file
  • hooks required to be in the post_update files
  • hooks in .theme files

11.2

Future

There is more planned!