try another color:
try another fontsize: 60% 70% 80% 90%
dueyesterday.net
Documentation for the masses

Drupal Skeleton Module Generator

After creating a couple modules in Drupal I noticed that I was using a lot of the same code and began copying certain functions from each module. Before I could use the function I would have to walk through and change all the names and little details to make the module work. Doing this twice was two time too many and I decided to write something that would take in the information required to generate a bare bones module and then create it for me.

I saw a few benefits to creating something like this. First, it provides new users with the ability to get their feet wet in regards to Drupal programming. The framework of the module is prebuilt and commented so that users really only need to add their core functioning code to the module to make it truly custom. The generated code acts as an aid for new Drupal developers as they can see what each function does and why it is present. Second, experience Drupal developers more than likely have some templates prebuilt for modules, but this web application is convient and take less than a minute to fill out. Once completed the developer has a fully functioning module that requires no changes to have running.

I have created the sub-domain (http://modgen.dueyesterday.net) where the application is running live. It is in early stages and does not do anything too fancy, but if you are interested in creating a new Drupal module then its a great thing to use. I would love to hear any feedback on the application and whether or not anyone would consider it beneficial to actually write a module for Drupal that then generates skeleton modules directly in Drupal's site directory (essentially having this web application directly available within Drupal).

Attached is the whole application if you would like to run it locally. If not then please feel free to use the one I am hosting. After completing the form, a zip file will be created containing the module folder, the info file and module file.

AttachmentSize
module_generator.zip23.3 KB
Your rating: None Average: 2.6 (5 votes)

Comments

Thanks very much

4

Thanks very much for creating this. It helped me get a grasp of the process of building a module. Especially the realization that not _everything_ in a module is a hook, some function names you still get to make up yourself. :)

if anything I would love to see more comments for beginners like me. maybe a checkbox at the top
* beginner (extra comments)

That if checked added extra help comments. and checkable so that the pro's dont need to get them if they don't want too.

Cheers.

ussher

I like the idea

I'll add in some more verbosity to the comments to explain what is going on. In the very least I will point you in a good direction to find more information if it's not my site.

Nice

Thanks. This looks really nice. I have just used it. One problem, the module name needs some validation. It should either do $name = preg_replace('/\-/', '_', $name) or use some validation to only access valid characters. I am using this for a module that I'll be releasing in the next few days.

Cheers

Dave Hall (aka skwashd)

Built without much in mind

I know the page itself has no validation now. I got a lazy when I threw it together and just wanted to provide users with the ability to generate a module. You do raise a good point though and I will look to see what I can do about making some changes.

I saw a few benefits to

I saw a few benefits to creating something like this. First, it provides new users with the ability to get their feet wet in regards to Drupal programming. The framework of the module is prebuilt and commented so that users really only need to add their core functioning code to the module to make it truly custom. The generated code acts as an aid for new Drupal developers as they can see what each function does and why it is present. Second, experience Drupal developers more than likely have some templates prebuilt for modules, but this web application is convient and take less than a minute to fill out. Once completed the developer has a fully functioning module that requires no changes to have running.