我写了一个简单的测试模块示例,2个文件,test.module,test.info,并在drupal 7模块中启用它们。Drupal 7示例模块,页面未找到,为什么?
我清除所有的缓存,并且还当我试图去为localhost/Drupal的/你好,我得到的Drupal未找到404页,这是为什么?
这里是我的代码:
<?php
function test_world_help($section) {
switch ($section) {
case 'admin/help#hello_world':
$output = '<p>Hello world help...</p>';
return $output;
case 'admin/modules#description':
return 'Hello world module description...';
}
}
function test_world_menu($may_cache) {
$items = array();
if ($may_cache) {
}
else {
$items['hello'] = array(
'title' => 'Hello world page...',
'callback' => 'test_world_page',
'access' => TRUE,
'type' => MENU_CALLBACK
);
}
return $items;
}
function test_world_page() {
return '<p>Hello world!</p>';
}
我很困惑,什么是test_world_page?没有页面钩http://api.drupal.org/api/drupal/includes--module.inc/group/hooks – Steven