Re: Which Pear Form package should I use??

From: Date: Wed, 05 Jan 2005 02:13:48 +0000
Subject: Re: Which Pear Form package should I use??
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-16614@lists.php.net to get a copy of this message
On Tue, 4 Jan 2005 17:46:37 -0600, Brent Clements <bclem@imaginative-enterprises.com> wrote: > I have written a pretty intensive application in php using my own kludge of classes and form > functions for a client of mine. I'd like to rewrite the application in something more elegant > such as one of the pear form packages. > > The description of the application is this. > > The application has a number of "pages". Each page correlates to a different type of > information requested. ie, one page could be customer information, application preferences, travel > information, hotel information, and so on and so on. Each page has sometimes up to 100+ form fields. > Each section of form fields can when posted be put into different database tables. Each page has a > navigation bar at the top and bottom which is "back - save - next". Each time a page is > "loaded", it's corresponding data is loaded from a database. It's a pretty large > wizard type application to be quite honest with you. Some of the pages are dynamic also. For > instance, depending on the number of days the user specifies, there is a page built for each day. > > Based on this information, what Pear form package would you guys suggest that would enable me > to write more elegant and structured code? > Well... HTML_QuickForm is the standard form package which has lots of features. HTML_Form is deprecated. In addition, if you're doing DB work (forms for tables from the DB), DB_DataObject_FormBuilder is very feature rich and customizable. (disclaimer: I am a FormBuilder lead ;-)) It will build forms based on the columns and their types from the DB (DB_DataObject) and will automatically insert or update based on whether you loaded data into the DO beforehand. However, if you're submitting the same form to multiple tables you'd have to hack something up to make this work. As long as the form is the same you should be able to switch DOs before processing, but this probably isn't a good idea. If you need to do the same customizations for two forms, you can have each of the DOs inherit from the same base class (which inherits from DB_DataObject) and put your customizations in there. Then you can do further table-specific stuff in each DO. -- Justin Patrin

« previous php.pear.general (#16614) next »