Never been to TextSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

drupal module_hook problem (See related posts)

// does not work

function testmodule_menu($may_cache) {
  if ($may_cache) {
    $items = array();
    $items[] = array(
      'path' => 'node/12',
      'title' => t('Testing 123'),
      'callback' => 'do_it',
      'access' => TRUE,
      'type' => MENU_CALLBACK);
    return $items;
  }
}



// works

function testmodule_menu($may_cache) {
  if ($may_cache) {
    $items = array();
    $items[] = array(
      'path' => 'nodenode/12',
      'title' => t('Testing 123'),
      'callback' => 'do_it',
      'access' => TRUE,
      'type' => MENU_CALLBACK);
    return $items;
  }
}

You need to create an account or log in to post comments to this site.


Related Posts