Interacting with hooks


show more Interacting with hooks provides you with in-depth training on Developer. Taught by Jon Peck as part of the Drupal 7 Custom Module Development show less
please wait ...

Interacting with hooks

Drupal uses a unique approach for providing an application programming interface. A hook is a PHP function that allows a module to hook into Drupal and modify behavior. A Drupal hook functions similar to a callback, in that they act as triggered events. Unlike an actual callback, hooks aren't registered with a listener. Instead, Drupal executes hooks based on their name up on a particular event. Hooks are similar to object oriented architecture in several ways.

Hooks are constructed with a strict naming convention with function names prefixed with a module name. Similar to an abstract method, each hook has a defined set of parameters and return type. To use a hook, a developer will implement the hook by writing a function that conforms to the naming convention and accepts the same parameters and returns the same type. There are hundreds of hooks available in Drupal core, allowing developers to manipulate practically every aspect of a page build. Some common examples of ho...

Interacting with hooks
Video duration: 8m 40s 2h 56m Advanced

Viewers:

Interacting with hooks provides you with in-depth training on Developer. Taught by Jon Peck as part of the Drupal 7 Custom Module Development

Subjects:
Developer Web
Software:
Drupal
Author:
please wait ...