[development] Convention for naming contrib hooks?

Earnie Boyd earnie at users.sourceforge.net
Fri Oct 16 13:27:26 UTC 2009


Quoting Nancy Wichmann <nan_wich at bellsouth.net>:

> Larry Garfield wrote:
>> It's generally good practice to prefix a hook with the name of your
>> module if you're not a core module
>
> Gosh, it's kind of my thoughts that if it can't be found with
> module_invoke_all(), then it's not a "hook" (an API maybe). And
> module_invoke_all() won't find the function unless it starts with the module
> name (core or contrib).
>
>

So I have a module foo implementing hook_foo_bar.  Module foo checks  
for any implementation of hook_foo_bar by calling  
module_invoke_all('foo_bar') in its foo_bar() function.

--
Earnie
-- http://r-feed.com/           -- http://for-my-kids.com/
-- http://www.4offer.biz/       -- http://give-me-an-offer.com/




More information about the development mailing list