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

From: Date: Thu, 21 Aug 2003 14:46:52 +0000
Subject: Re: New package: DB_DataObject_FormBuilder (was: Re: [PEAR-DEV] Re: DataObjectOnSpeed Sum-Up)
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-20275@lists.php.net to get a copy of this message
Hi! Bertrand Mansion wrote:
The HTML_QuickForm_Page has a method to build the form upon request, that's where HTML_QuickForm_Builder could be useful.
Yes, thus DB_DataObject_FormBuilder needs to have an additional method like _generateForm() that will accept an instance of QuickForm instead of instantiating it itself. This will be sufficient to plug it into Controller infrastructure. Or changing the API of getForm() from &getForm($action=false, $target='_self', $formName=false, $method='post') to getForm(&$form, $action=false, $target='_self', $formName=false, $method='post') and instantiating the form only when needed...
Why add all those parameters as they are already defined in $form ?
What I meant is you either do $form =& new HTML_QuickForm(...lots of params...); getForm($form); or getForm($form, ...lots of params...); and in getForm(): if (null === $form) {
    $form =& new HTML_QuickForm(...lots of params...);
} Hope that's clearer now. :]

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