这是我的模块文件。
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时。它显示访问被拒绝,为什么?
答案 0 :(得分:1)
您应该查看以下答案:Can someone explain "access arguments" in Drupal?并查看hook_menu()
如果您想允许所有人访问,您还可以使用'access callback' => TRUE