0
votes

I am trying to learn about modules and hook menus. I followed this tutorial. https://www.youtube.com/watch?v=bjxML7A19Zs

The My Hello Page link works and takes me to the correct page (http://localhost:8012/Adrupal/content/weee). My problem is that the textfield and title(Enter your name) does not show up. I am using Drupal 7. I have not downloaded any extra modules for this tutorial.

I always flush the cache, after every change.

File url: all/modules/hello/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;

}

I have no idea what i did wrong. Any help would be appropriated.

2

2 Answers

0
votes

your callback function does not have argument supplied

function hello_showHelloForm($form, &$form_state, $argument) {}
0
votes

It could happen if you have put "&" before $form:

func_name(&$form, &$form_state)