2016-07-06 82 views
0
hook_menu頁

工作,我創建了一個簡單的模塊,具有hook_menu主題不是

function course_list_menu() { 
    $items['course-list'] = array(
    'title' => 'Example Page', 
    'page callback' => 'course_list_page', 
    'access arguments' => array('access content'), 
    'type' => MENU_NORMAL_ITEM, 
); 
return $items; 
} 

    function course_list_page() { 
    print '<h1>WILL BE UP SOON </h1>'; 
    print '<h3>this page is getting build<h3>'; 
    } 

正如我在YouTube和其他一些網站的例子看到,這段文字應該來在內容區域,當我訪問鏈接(帶有頁眉和頁腳)。但在我的情況下,它是在一個空白頁 我錯過了一些東西? 如何在內容區域中顯示此內容。

我的電流輸出爲http://prntscr.com/bpff9q

  • 使用引導主題

回答

0

您需要返回的東西,Drupal的可以工作,並適用於模板文件等。

試試這個:

function course_list_page() { 
    return array('#markup' => '<h1>WILL BE UP SOON </h1><h3>this page is getting build<h3>'); 

}

+0

哎呀!謝謝 –