Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

DevShed:
Building a PHP Form Generator (Pt. 2)
Apr 12, 2005 @ 13:17:38

DevShed.com has the second part in their Inheritance and Polymorphism in PHP series, building on the base from the previous piece to expand the form building class functionality.

Stepping back to refresh our memories, we defined a base form object class and derived each subclass that defines the bare bones for each form element. For the complete list of classes, please take a look at the first article, to quickly grasp how they were structured. It's fairly simple.

In this second article, we will get a bit more complex. We're going to complete the source code for each class definition, having an overall concept of the mechanism to make the form generator work properly.

The subclasses that they use help to make their form builder flexible, but it also can get confusing very, very quickly - especially for someone not too comfortable with OOP in PHP yet. If you need the power that this kind of solution deserves, then go for it - otherwise, you might want to look into other, easier to use options...

tagged:

Link:


Trending Topics: