When you want to create a module in Drupal, it is ideal to make use of what are called hooks. Hooks are methods implemented inside of a module that Drupal already knows how to pickup and use when it's needed. There are hundreds of hooks that are built in Drupal 7 core which you can implement and each one has a different purpose. Some of the hooks are generally called as part of other hooks. You can even call hooks from other modules or core parts of Drupal within the hooks specific to your module. Hooks provide a great framework which Drupal knows how to pick up on so if you want to create your own Drupal module you definitely want to use them to make the most of your efforts.

When you look at the listing of hooks on the main Drupal site, you will notice that almost every hook starts with the word hook followed by the rest of the title describing the function itself. To implement a hook specific to your module you must replace the word hook with the file name of your module. For instance if your module's code is stored in hello_world.module and you want to implement the help hook for that module then the name of the function would be hello_world_help when you go to implement it.

function helloworldhelp($path, $arg) { switch($path) { // Main help page case 'admin/help#hello_world': return '

' . t('Hello World is a module that will display the message ' . . '"Hello World" onto the screen. Wow! Now that\'s impressive') . '

'; } }