
All about the children. It is merely a free flow of thoughts that require no plan of putting it together to make a nice story. This site is never intended to be read by other people nor does it plan to get any followers.
Showing posts with label form. Show all posts
Showing posts with label form. Show all posts
Monday, April 9, 2012
variable_set(), variable_get() and system_setting_form()
Some explanations on the use of variable_set(), variable_get() and system_setting_form().


You can get the complete info here.


You can get the complete info here.
mental note on drupal form coding
This is a mental note for me to do. I need to make a summary of what are the things that i've learnt when developing form in drupal. Until now, i can only summarise that there are too many complex commands that require me to understand. So it's better if i can summarise them all in a single illustration so that it's easier to mentally digest.
.
.
Friday, April 6, 2012
Writing drupal module - Form creation
After 3 days have passed, i finally able to continue my drupal module coding. Today, what i did is creating form elements inside drupal site.
The order of creating form in drupal is like this:
And the following videolog is the output from the new codes
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
Subscribe to:
Posts (Atom)