Re: Need clarification on DB_DO_FormBuilder Wiki
| From: | Justin Patrin | Date: | Thu, 01 Jun 2006 15:43:15 +0000 |
| Subject: | Re: Need clarification on DB_DO_FormBuilder Wiki | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-24224@lists.php.net to get a copy of this message | ||
On 6/1/06, Michel D'HOOGE <m.dhooge@enertecgroup.com> wrote:
Hello I am reading the FormBuilder wiki with the uttermost interest and I found some comment that either I don't understand properly or are wrong. In both cases, I think something should be done ;-) http://pear.reversefold.com/dokuwiki/doku.php?id=pear:db_dataobject_formbuilder:callback_methods#pregenerateform_fb preGenerateForm(&$fb) This method will be called before the form is generated. Use this to change property values or options in your DataObject. This is where you should set up fb_preDefElements. Since the formbuilder instance is provided, isn't is simpler to directly modify $fb? I'd rather do $fb->preDefElements for instance.This is your choice. See the section on all of the ways to set configuration options. Be forewarned, though, that if you set the same thing in the DO and in the FB the ones set in the DO will overwrite the ones in the FB. I always set table-specific options in the DO so that if I add options to the DO later I won't be surprised by some other options seeming to disappear.
The one parameter is the FormBuilder object which will be passed into this method by reference. You can access any settings or functions you need. Note: options in the DataObject will not be copied over into the $fb automatically until after preGenerateForm(). If you need them in there or need to use FormBuilder functions which rely on them, call... The sentence is not clear for me :-( Is it correct if I write: Note: Options defined in the DataObject ($fb_*) are only copied into the $fb instance after preGenerateForm() has been called. If you need them in preGenerateForm() or use FormBuilder functions which rely on them, call...That's basically the same thing. You're free to go ahead and change it, that sentence seems to be a bit more specific.
-- Michel -- PEAR General Mailing List (http://pear.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php-- Justin Patrin