开发者

why this code can't work in drupal?

开发者 https://www.devze.com 2023-02-19 16:28 出处:网络
this is my module file. function mymenu_menu() { $item开发者_如何学C=array(); $item[\'welcome\'] = array(

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

0

精彩评论

暂无评论...
验证码 换一张
取 消