2011年2月22日 星期二

Add a field to Module Update page

By Module Update page, i mean the page shown when you add a new activity or update it.

Note: You should add a field to the database first if you want to save the entered field information.

  1. Open mod\your_mod\mod_form.php
  2. Add this line: $mform->addElement('text', 'your_field', 'label_shown', array('size'=>'64'));
  3. Done

Note2: your_field is the field name in the database of table mdl_your_mod, the field information will save to the table

Note3: To show the field, just use $your_mod->your_field

1 則留言:

  1. What can i do if I need List with my elements like in 'Format' ?

    回覆刪除