Article
Posted on 15th September 2021
Takes about 6 mins to read

Does writing hooks make you sad because the code is too procedural? Are you keen to use the object-oriented programming approach that Drupal and its service container enable, wherever you possibly can? Read on if you answered yes to any of those questions.

Published in: #Drupal Planet #alter hook #object
Article
Posted on 14th June 2016
Takes about 3 mins to read

In Drupal 7 if you wanted to tweak the functionality of an existing function then an alter hook was your best friend, but in Drupal 8 it's "all change!" With the introduction of Symfony, your new BFF is an Event Subscriber. Alter hooks still exist, but it is recommended that we all move towards Events to fall in line with Symfony. If you are interested in the comparison between alter hooks and events then I...