Designing a web site in parts

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Post Reply
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Designing a web site in parts

Post by alex.barylski »

I need to include a FORM builder into my existing site layout. The way I see it I have two options:

1) I create a seperate script which uses the Smarty template which powers my site layout
2) I find a FORM builder which opens in a popup window and no theming is applied

The former appeals to me but the idea of creating another script is a PITA. The latter would let me drop in the FORM builder and start immediately. I've considered building a FORM builder myself but struggle with the above problem of integration into my existing CMS or other third party CMS systems.

I like keeping my directory(s) clean as possible using DB and mod_rewrite, so adding a script to pull on the template and deliver the generated FORM isn't ideal but neither is using a popup and hosting the script on an external server.

Assuming I've made some sense, how do you handle these situations? Which would you prefer and why?
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

I build my own forms with HTML. It's far easier to change the look and feel of the form in the template this way (especially if you're going to have a designer work on the same code). With some CSS to pretty things up a bit, forms are pretty quick to write. You'll probably spend longer finding one that fits all your requirements than it would take to just write the stuff yourself.
User avatar
Todd_Z
Forum Regular
Posts: 708
Joined: Thu Nov 25, 2004 9:53 pm
Location: U Michigan

Post by Todd_Z »

It depends how "cookie cutter" you want your forms to be. If its a question of simply inputs, selects, etc, it shouldn't be so bad. But once you get complicated with the types of inputs you have, for examples auto completes, calendars, etc, a class to deal with that stuff becomes less realistic. If its a complicated form, write the html. Else, make yourself a nice little form, and form_element class.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

symfony has helpers, but it won't just do it all for you:

http://www.symfony-project.com/book/trunk/10-Forms
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Make your forms like you make your XHTML.... custom. Then style them and apply code to them as needed for effect.

I usually code my own forms. I typically use the HTML elements associted with forms (fieldsets, legends, labels, etc) and assigne them id's and classes as needed so I can interface with them in JS or CSS.
Post Reply