The order of creating form in drupal is like this:
- use command 'page callback' where its value is the key function in drupal called drupal_get_form()
- use command 'page arguments' whose value is an array that contains a value referring to a name of function (must use underscore in a single word, eg: nama_saya_shahrul. this value - nama_saya_shahrul will be passed to key function drupal_get_form() for drupal to process the form.
- Create function nama_saya_shahrul($form, &$form_state), this is just an example.
- use variable array that has the followings (make sure you never miss out the hash)
- #type
- #title
- #description
- #default_value
- #size
- #maxlength
- #required
- #type
- Need to use another drupal-specific function called variable_get('nama_textfield',default-value). I think variable_get() is similar to session() or assigning value to hidden form field where we can retrieve them later on.
- last but not least is using system_settings_form($form) function.
And the following videolog is the output from the new codes
No comments:
Post a Comment