问题
I have been searching the net and i have not found out anywhere that explains the access callback and access arguments for hook_menu. What I think so far is that it controls who can access the module (correct me if I am mistaken).
So can someone explain how hook_menu access callback and access arguments works and how you would go about if you were going to set the module to only administrators or only registered users to see your module.
Also I am working on Drupal-7
回答1:
I think what you are looking for is provided in an example at http://drupal.org/node/553368.
You are correct, you use the access arguments to identify the access level required to access whatever is mapped from the $item to the callback.
:)
来源:https://stackoverflow.com/questions/12994899/drupal-hook-menu-explanation