Quick Tip: Drupal Hook Commenting Using Vim
14 November 2011
vim
Drupal
programming
According to the Drupal Coding Standards for Documenting Hook Implementations, its considered a good practice to quickly chuck a comment before any function which implements a Drupal hook (eg, hook_menu
). This helps someone reading your code quickly see that the function is actually linked with a hook in Drupal and isn't just a function in your module to be called directly.
But… Well… The thing is… Does anyone else get bored of writing the following over and over again? I know do…