我想了解模塊和鉤子菜單。 我遵循本教程。 https://www.youtube.com/watch?v=bjxML7A19ZsDrupal鉤子菜單 - textfield不顯示
「我的你好」頁面鏈接起作用並帶我到正確的頁面(http://localhost:8012/Adrupal/content/weee)。我的問題是,文本字段和標題(輸入你的名字)不顯示。我正在使用Drupal 7.我沒有爲本教程下載任何額外的模塊。
我總是在每次更改後刷新緩存。
文件網址:所有/模塊/你好/ hello.module
function hello_menu(){
$items=array();
$items['content/weee']=array(
'title'=>'My Hello Page',
'description'=>'My Hello users',
'page callback'=>'drupal_get_form',
'page arguments'=>array('hello_showHelloForm'),
'access callback'=>'user_access',
'access arguments'=>array('access content'),
'type'=>MENU_NORMAL_ITEM
);
return $items;
}
function hello_showHelloForm($form, &$form_state, $argument){
$form=array();
$form['name']=array(
'#type'=>'textfield',
'#title'=>'Enter your name'
);
return $form;
}
我不知道我做錯了什麼。任何幫助將被佔用。
我加你改變我的代碼。不幸的是,它沒有奏效。 – Kong
你能不能發佈你的更新代碼片段 –
你好,我更新了代碼。 – Kong