Missing something simple
caelon - March 28, 2008 - 02:37
I created the following short test module to understand how paths work. This code is installed in /sites/all/modules/scoreos. When I go www.url.com/scoreos/test or www.url.com/scoreos/?q=test or www.url.com/?q=scoreos/test, they all send me to a 404 page. I'm sure there's something simple I'm missing but I don't see it yet. Any ideas? Thanks in advance.
<?php
function scoreos_test_menu($may_cache) {
$items = array();
if ($may_cache) {
$items[] = array(
'path' => 'scoreos/test',
'title' => t('Test'),
'callback' => 'scoreos_test_start_page',
'access' => TRUE
);
}
return $items;
}
/**
* Called when user goes to /?=test
*/
function scoreos_test_start_page() {
$output = t('This page contains our test.');
return $output;
}
?>
Try this...
You should be trying to implement hook_menu with hook as your module name, so try with;-
<?phpfunction scoreos_menu($may_cache) {
?>
___________________
It’s in the detaιls…
Thanks zeta
That was the hint I needed. ScoreOS is really a collection of modules, so it ended up being test_menu, but you got me there.