During a project, it is very likely that we will have to create one or more custom modules. This, at the very least, involves creating a directory at sites/all/modules/custom/module_name
, plus the module_name.info
and module_name.module
files within that directory with some hook implementations. Module Builder provides a very powerful Drush command to generate all the boilerplate code that we need to start working with our module.
We will create a module that implements the hooks hook_menu(), hook_block(), hook_theme()
, and hook_permission()
. The command mb-build
launches an interactive process to gather all the information needed to create the module. Here is an example, where we download and install it and then create our custom module:
$ drush pm-download module_builder
Project module_builder (7.x-2.x-dev) downloaded to [success] /home/juampy/projects/drupal/sites/all/modules/contrib...