drupal--hook_menu [英] drupal--hook_menu

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

问题描述

info 文件是对的,下面是我的模块文件代码.当我访问 http://localhost/drupal/mymenu 为什么它不能工作.

the info file is right,the following is my module file code. when i access the http://localhost/drupal/mymenu why it can't work.

  <?php
 function mymenu(){
    $item = array();
  $item['mymenu'] = array(
       'description'=>'test1',
      'page callback'=>'mymenu_test',
      'access arguments' => array('access mymenu'),
     'type'=>MENU_CALLBACK,
 );
 return $item;
 }

  function mymenu_perm(){
   return array('access mymenu');
  }

 function mymenu_test() {
 $output = 'hello world';
 return $output;
}

我已将访问我的菜单"权限授予匿名者.

i have gave the 'access mymenu' permission to the anonymous.

推荐答案

应该是

<代码>函数 mymenu_menu() {...}

你不需要 $item = array();还有.

You don't need the $item = array(); there also.

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

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