[development] Rename hook_menu ?

Gary Feldman dpal_gaf_devel at marsdome.com
Thu Dec 14 13:12:30 UTC 2006


Khalid B wrote:
> I agree that hook_menu() is better off renamed.
>
> This hook is the core of Drupal, and old timers know what it is. For 
> new comers, it is not obvious why it is called menu.
>
> hook_router() seems like the best choice so far, the menu items 
> "route" requests to different functions.
As a relative newcomer, "route" is worse than "menu."  Route is too tied 
into to network usage, bringing to mind something that redirects URLs 
instead of registering available functions.  I prefer the "dispatch" 
suggestion, but think "register" is even better - but then that's coming 
from a familiarity with dependency injection, where "register" is common 
usage.

But again, as a relative newcomer, I had no trouble with the concepts 
around hook_menu, and my bottom line opinion is to leave it alone.  The 
introduction in menu.inc accomplishes the job.  I think it would be more 
useful to have a middle level view of Drupal processing, something in 
between the handbook page "Introduction to Drupal modules" page and the 
three "Drupal's * serving|building mechanism" pages.

Gary



More information about the development mailing list