0

here is my code

function custom_menu() {
  $items['award/offer'] = array(
    'page callback' => 'award_offer_email',
    'page arguments' => array(1,3),
    'type' => MENU_CALLBACK,
  );
}

Here I have passed the url like http://dev.webroot.com/award/offer but I am getting

The requested page "/award/offer" could not be found.

Any ideas?

ADyson
  • 57,178
  • 14
  • 51
  • 63

3 Answers3

3

first you need to return your menu items. Other than that you also need to give access to your arguments.

Rewriting Your Example:

function custom_menu() {
   $items['award/offer'] = array(
    'page callback' => 'award_offer_email',
    'page arguments' => array(1,3),
    'type' => MENU_CALLBACK,
    'access arguments' => array('access content'),
  );

  return $items;
}

Now clear your cache and check it!

1

Did you clear cache after updating hook_menu()?

wau
  • 426
  • 3
  • 8
0
function custom_menu() {
   $items['award/offer'] = array(
    'page callback' => 'award_offer_email',
    'type' => MENU_CALLBACK,
    'access arguments' => array('access content'),
  );

  return $items;
}

Clear cache menu (if you are using drush : drush cc menu) and refresh your page

https://api.drupal.org/api/drupal/modules%21system%21system.api.php/function/hook_menu/7.x

Fky
  • 2,133
  • 1
  • 15
  • 23