views:

26

answers:

0

I am developing a Form class in PHP responsible for displaying and validating an HTML form.

I know generally what the Decorator design pattern is, and I know Zend_Form uses the pattern extensively to provide easy customization to its output of the form.

I have looked through the source for Zend_Form, and cannot make heads or tails of how it works.

How can I use the Decorator design pattern to provide customizability (HTML-wise) to my Form class without forcing the user (of the class) to subclass it and override half a dozen methods to, for example, change from a <table> based layout to a <dl> based one, and is it something I can easily implement, or will it take too much time and be too complex?