Drupal’s menu system follows a
simple hierarchy defined by paths.
Implementations of hook_menu () define menu items and assign them to paths (which should be unique).
The menu system aggregates these items and determines the menu hierarchy from the paths.
When responding to a page request, the menu system looks to see if the path requested by the browser is registered as a menu item with a callback. If not, the system searches up the menu tree for the most complete match with a callback it can find,
The found callback function is called with any arguments specified in the “page arguments” attribute of its menu item. The attribute must be an array. After these arguments, any remaining components of the path are appended as further arguments.
Access to the callback functions is also protected by the menu system. The “access callback” with an optional “access arguments” of each menu item is called before the page callback proceeds. If this returns TRUE, then access is granted; if FALSE, then access is denied.
Everything is stored in the menu_router table.
The menu_links table holds the visible menu links.
By default these are derived from the same hook_menu definitions, however to add more use menu_link_save ().
Implementations of hook_menu () define menu items and assign them to paths (which should be unique).
The menu system aggregates these items and determines the menu hierarchy from the paths.
When responding to a page request, the menu system looks to see if the path requested by the browser is registered as a menu item with a callback. If not, the system searches up the menu tree for the most complete match with a callback it can find,
The found callback function is called with any arguments specified in the “page arguments” attribute of its menu item. The attribute must be an array. After these arguments, any remaining components of the path are appended as further arguments.
Access to the callback functions is also protected by the menu system. The “access callback” with an optional “access arguments” of each menu item is called before the page callback proceeds. If this returns TRUE, then access is granted; if FALSE, then access is denied.
Everything is stored in the menu_router table.
The menu_links table holds the visible menu links.
By default these are derived from the same hook_menu definitions, however to add more use menu_link_save ().
No comments:
Post a Comment