Get 35% Off CFI Certifications - Code CFI35
Start speaking a new language. It’s just 3 weeks away.
Overview
Coursera Flash Sale
40% Off Coursera Plus for 3 Months!
Grab it
Learn how to transition from Drupal's traditional magic naming conventions to modern PHP language features in this 21-minute conference talk. Discover how Drupal 11.1 transforms the familiar hook system from functions with magic names like mymodule_block_info or mymodule_form_alter into object-oriented methods using PHP attributes. Explore the evolution from magic naming conventions that worked consistently through Drupal 11.0 to the new class-based approach that enables better code organization, improved testing capabilities, and dependency injection. Understand how hook_block_info transitioned to plugins using PHP annotations and how the major change in Drupal 11.1 allows most hooks to become methods on classes. Gain practical knowledge on adapting your code to the object-oriented hook definition approach while maintaining the same ease of use as the traditional magic naming system. Master the implementation of hooks using modern PHP features that provide significant developer experience improvements without requiring prior familiarity with Drupal 7 and earlier versions.
Syllabus
Hooks, from magic names to php language feature
Taught by
Drupal Association