Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

YouTube

Hooks - From Magic Names to PHP Language Feature

Drupal Association via YouTube

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

Reviews

Start your review of Hooks - From Magic Names to PHP Language Feature

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.