我寫了一個簡單的測試模塊示例,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