[development] Splitting hook_menu into hook_menu and hook_router

adrian rossouw adrian at bryght.com
Thu Jan 18 01:09:29 UTC 2007

On 17 Jan 2007, at 9:06 PM, Dries Buytaert wrote:

> I agree that a logically seperation is a good thing, but this in
> particular case, it seems as if there is some overlap.  For example,
> both routers and menus would have to do access control ...
I also realized that the overlap isn't as much as you'd think

Menu items can point to user/1 or node/12345. These would still need  
to be mapped to the
'node/%s' router. Which then gets the access permission.

Another idea I had was to pass the routes to the menu hook, and allow  
people to do the following: (i'm not sure what we are using as the  
wildcard now)

function module_menu($routes) {
    $menu['wherever/too'] = drupal_menu('node/12345', $routes['node/% 
s'], $array_props);

#  or alternatively perhaps :

    $menu['wherever/this/is/shown'] = drupal_menu('user/12') // this  
could do the mapping and cache it. (without the need for recursion  
through the whole tree later)

    return $menu;

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/development/attachments/20070118/f313c1ff/attachment-0001.htm 

More information about the development mailing list