RE: [PEAR] DB_Dataobject_FormBuilder code examples
| From: | Mike Carter | Date: | Tue, 27 Apr 2004 10:02:01 +0000 |
| Subject: | RE: [PEAR] DB_Dataobject_FormBuilder code examples | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-12156@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: Mike Carter [mailto:mikeatwork@ukonline.co.uk]
>
>
>
> > -----Original Message-----
> > From: Markus Wolff [mailto:wolff@21st.de]
> > Sent: 26 April 2004 19:14
> >
> > Mike Carter wrote:
> >
> > > Hi,
> > >
> > > I realise a couple of people (at least) have been
> > experimenting with the
> > > FormBuilder class on PEAR recently.
> > >
> > > I was wondering if they had any code which demonstrates how
> > the subclassing
> > > and over riding of getForm() etc is done to add/remove form
> > elements to make
> > > the output more customised.
> >
> > Hi Mike,
> >
> > you don't use getForm() to add/remove form elements. The
> hook methods
> > are as follows:
> >
> > - preGenerateForm:
> > Here you can define some special fields prior to form
> > building. These
> > fields are used as you define them here, nothing else is
> > added to them
> > by FormBuilder.
> > - getForm:
> > This is a substitute for the whole form building process -
> > if you use
> > getForm(), you make the whole form right here.
> FormBuilder won't do
> > anything (except, perhaps, manage data storage later), and
> > the pre-/
> > postGenerateForm methods become obsolete.
> > - postGenerateForm:
> > This one's triggered after FormBuilder auto-created a
> form based on
> > your DataObject. As the form object is passed by
> reference, you can
> > now modify it freely (as in adding/removing elements,
> setting rules
> > etc.)
>
> Thanks for your reply. I was working off the comments in the
> FormBuilder
> class.
> The 'hook' methods that you mention above, how are they supposed to be
> accessed - I don't understand from what is written down - how
> everything
> fits together when auto generating a form from a DataObject?
Taking another look at the comment in the Form Builder class I noticed a
mention about putting these hook methods in to my auto generated DataObjects
before passing them in to the FormBuilder method. Seems fair enough.
Would be good to see even a rough skeleton of a manual on the PEAR website
for this package.
I noticed in another email dated back on 14/04/2004 you mention examples for
FormBuilder. I never found these as the PEAR command line installer doesn't
put Examples anywhere - oops! Will go examine the examples in CVS now.
Regards,
Mike C.
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________