Release Day: Extending Drupal 8 with Hooks

Module Development Guide

We've just added four more tutorials to our Drupal 8 Module Development Guide. This week we continue with the recent theme of teaching you how a module can extend, alter, and enhance Drupal without modifying core code by looking at hooks.

Did you know that hooks where introduced to Drupal way back in 2001? Hooks have been the workhorse of Drupal module developers since the beginning. And they continue to play an important role in Drupal 8. In these new tutorials we define hooks and cover the use-case they serve. We walk through how to discover existing hooks, as well as how to implement any hook. We also look at when you might want to consider implementing the hooks pattern to allow others, or even future you, to extend your custom code, and how to do so.

This is essential information for anyone developing modules for Drupal. Contents include:

As a byproduct of creating this new set of tutorials we also contributed a new hooks_example module to the Examples for Developers project on, where you can find all the sample code used for this tutorial and more.

In the coming weeks we'll be continuing to add additional content to our Drupal 8 Module Development Guide, as well as making updates and additions to our existing Configuration Management and Entity API guides.


Add new comment