why this code can't work in drupal?
this is my module file.
function mymenu_menu() {
$item开发者_如何学C=array();
$item['welcome'] = array(
'title' => 'welcome',
'page callback' => 'mymenu_test',
'type' => MENU_CALLBACK,
);
return $item;
}
function mymenu_test(){
$output = 'welcome user!';
return $output;
}
when i access example.com/welcome. it show access denied, why?
You should check out this answer : Can someone explain "access arguments" in Drupal? and take a look at hook_menu()
If you want to allow everyone access, you can also use 'access callback' => TRUE
精彩评论