Is there a File Name Standard or Convention?

Events happening in the community are now at Drupal community events on www.drupal.org.
Posted by zzolo on May 20, 2009 at 3:50am

Is there a File Name Standard or Convention?

I have set of modules that have lots of includes. Is there any written documentation on how these things should be organized. For instance with JS file I like to put in a JS folder in the module, but even then I am not sure how to name the files. I know if there is one its "modulename.js", but what if there are many?

I guess there seems to be 3 main ways of doing this:

  • Dots: modulename.function.js
  • Underscores: modulename_function.js
  • Dashes: modulename-function.js

This can apply to all types of files, JS, CSS, PHP. With PHP there seems to be the .inc sort of standard, but I am not even sure how that is supposed to work. Any help is appreciated.

Comments

Dashes or underscores

Posted by marcp on August 1, 2011 at 9:12pm

Yow, zzolo, over 2 years since this post! http://drupal.org/coding-standards#naming specifies a file name standard for the all important README.txt file.

It seems that dashes go in .tpl.php file names. Plenty of contrib modules are using dashes in .js and .css file names. What's a module developer to do?

Coding standards

Group organizers

Group categories

Status

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

AltStyle によって変換されたページ (->オリジナル) /