Re: New package: DB_DataObject_FormBuilder (was: Re: [PEAR-DEV] Re: DataObjectOnSpeed Sum-Up)

From: Date: Thu, 28 Aug 2003 15:22:11 +0000
Subject: Re: New package: DB_DataObject_FormBuilder (was: Re: [PEAR-DEV] Re: DataObjectOnSpeed Sum-Up)
References: 1 2 3  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-20757@lists.php.net to get a copy of this message
Hi! Markus Wolff wrote:
I´m not yet happy with this solution though as this means that I have to pass the option array by reference - this makes things unnecessarily complicated when not using any options at all... as I now always have to make an instance like this: $options = array(); $f = DB_DataObject_FormBuilder::create($do, $options); ...even if I don´t use options (as seen above). If I want to pass a QuickForm object, it´s like this: $options = array('form' =& $form); $f = DB_DataObject_FormBuilder::create($do, $options);
Looks ugly. :]
I prefer passing it by reference, though... I guess I´ll take it out of the options array and make a separate method setForm() or useForm() with which the object can be passed...
I like this approach better, too.
What do you think? And is this feasible for using the FormBuilder together with the new QuickForm_Controller?
Yes, this is sufficient. My only requirement is the ability to pass an existing object by reference (as $this will be most probably passed), the concrete implementation is up to you.

« previous php.pear.dev (#20757) next »