[development] RFC: info hook standardization

Earl Miles merlin at logrus.com
Mon May 19 18:24:11 UTC 2008


Darrel O'Pry wrote:
> On Mon, May 19, 2008 at 12:46 PM, John Wilkins <drupal.user at albin.net 
> <mailto:drupal.user at albin.net>> wrote:
> 
>     HOOK_theme() fits the criteria you outlined, except for one item:
>     "It takes no parameters." 
> 
> 
> Many other hooks also have no args, module_invoke_all has been able to 
> support 0-n args for a long time. This is a problem long since solve in 
> php and in various parts of drupal already. func_get_args, 
> call_user_func_array(), etc...
>  
> 
>     HOOK_theme() actually has 4 parameters that are essential for theme
>     developers. Of course, HOOK_theme() is a special case since themes
>     (and not just modules) can call that hook. (And, btw, themes can't
>     call the corresponding HOOK_theme_registry_alter().)
> 
> 
> Themes can all call any hook. This is not a special case.  Really you're 
> going to have to explain, "themes can't call the corresponding 
> HOOK_theme_registry_alter()". Why not?

By 'call' he meant 'implement'.

Themes get a special HOOK_theme() that is exactly like the module 
version, but they do not get a corresponding alter.


More information about the development mailing list