[development] Splitting hook_menu into hook_menu and hook_router

Karoly Negyesi karoly at negyesi.net
Thu Jan 18 12:48:06 UTC 2007


> > $menu['navigation']['create content']['book page'] = array('title'  
> > => t('Book page'), 'weight' => 5);
> 
> I like that because it is very intuitive.  Although it is not clear  
> what the difference is between 'book page' (array key) and 'Book  
> page' (array title) or what happens when I have different 'book  
> page's at different positions in the menu tree?  

Difference is that pesky t() in the title value. And no, it's not a solution that we throw everything that's title to t() because title can be basically anyhting. Yes, I have thought of this long. Or do you want title callback/ title arguments introduced? I have it in my mind, it would work quite nicely, but I fear I will be lynched if I introduce another callback :) Well, here it is: title callback defaults to t(), the first argument is actually title and additional arguments are in title arguments.

The array keys are trying to describe the links you click through, so if it's somewhere else then the array keys are different. 


More information about the development mailing list