Drupal hook_menu explanation

☆樱花仙子☆ 提交于 2019-12-11 15:45:58

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!