runeveryday
runeveryday

Reputation: 2799

why this code can't work in drupal?

this is my module file.

 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;
 }

when i access example.com/welcome. it show access denied, why?

Upvotes: 0

Views: 47

Answers (1)

Laxman13
Laxman13

Reputation: 5211

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

Upvotes: 1

Related Questions