Standards for documenting implementations of theme functions

Events happening in the community are now at Drupal community events on www.drupal.org.
Posted by rstamm on May 19, 2010 at 4:06pm

We don't have a standard doc header for implementations of themeable functions like THEME_process_HOOK and theme_breadcrumb.

my suggestion:

/**
* Implements THEME_process_HOOK().
*/
function garland_process_page(&$variables) {
//...
/**
* Implements theme_breadcrumb().
*/
function garland_breadcrumb($variables) {
//...

or

/**
* Overrides theme_breadcrumb().
*/
function garland_breadcrumb($variables) {
//...

and simular to hook implementations, it is rather standard and does not require more explanation.

Comments

Yes we do.

Posted by jhodgdon on May 19, 2010 at 11:03pm

no info on documenting overriding functions

Posted by pieter_duijves on August 20, 2010 at 2:54pm

hi jhodgdon,

the link you gave helps in learning how to document a theme function (eg: theme_breadcrumb()), but i think it does explain how to comment an OVERRIDING function (eg: garland_breadcrumb()).

maybe i need to search better... cheers! Pieter

True!

Posted by jhodgdon on August 22, 2010 at 12:31am

I think your suggestion of a one-liner saying "Overrides theme_whatever()" is a good one.

For hook implementations, you can follow this standard:
http://drupal.org/node/1354#hookimpl

Coding standards

Group organizers

Group categories

Status

Group notifications

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

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