为什么这段代码不能在drupal中工作?

时间:2011-03-26 02:01:12

标签: drupal drupal-6

这是我的模块文件。

 function mymenu_menu() {
 $item=array();
  $item['welcome'] = array(
   'title' => 'welcome',
  'page callback' => 'mymenu_test',
 'type' => MENU_CALLBACK,
 ); 

   return $item;
  }



  function mymenu_test(){
 $output = 'welcome user!';
 return $output;
 }

当我访问example.com/welcome时。它显示访问被拒绝,为什么?

1 个答案:

答案 0 :(得分:1)

您应该查看以下答案:Can someone explain "access arguments" in Drupal?并查看hook_menu()

如果您想允许所有人访问,您还可以使用'access callback' => TRUE