We just posted our new online tool which generates a full custom Drupal module. This post talks about that tool and how modules fit in to the Drupal ecosystem.
A little background first. Occasionally Jason and I will answer questions on the Drupal.org Module Development and Code Questions forum. Some time last year, someone asked for a "Hello World" module. A "Hello World" application is a barebones implementation of any development environment. If you read any books that cover programming languages they inevitably start with a "Hello World" example. So on the Drupal.org forum, I posted a simple "Hello World" module for Drupal 7. That post generated an unusual amount of interest. Therefore we decided, rather than just repost the "Hello World" example, we would create a tool to allow folks to generate their own.
So our online tool allows you to name the module and customize the package name. The module itself, is still only going to do 2 things:
- Creates a menu item link (so folks can click and invoke the hello function).
- Creates a custom function which simply displays "Hello World"
However, for a developer, the tool
- Creates the proper directory structure and name.
- Creates the proper file listings.
- Creates a custom "info" file that allows you to install your custom module in your Drupal installation.
- The source code includes an implementation of hook_menu().
So the developer gets a starter it. You can add addition functions, menu items etc. The proper naming conventions are started for you (by our tool).