Drupal hook_menu说明 [英] Drupal hook_menu explanation

查看:118
本文介绍了Drupal hook_menu说明的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在搜索网络,却找不到任何解释hook_menu的访问回调和访问参数的地方.到目前为止,我认为它控制着谁可以访问该模块(如果我输入错了,请纠正我).

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).

因此有人可以解释hook_menu访问回调和访问参数的工作原理,以及如果要将模块设置为仅管理员或仅注册用户才能查看该模块,您将如何处理.

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.

我也在研究Drupal-7

Also I am working on Drupal-7

推荐答案

我想在您是正确的,您使用访问参数来标识访问从$ item映射到回调的内容所需的访问级别.

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.

:)

这篇关于Drupal hook_menu说明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆