QuickForm templates (was: Smarty vs PEAR::HTML_Template_IT)

From: Date: Tue, 17 Dec 2002 16:27:47 +0000
Subject: QuickForm templates (was: Smarty vs PEAR::HTML_Template_IT)
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-3020@lists.php.net to get a copy of this message
<jeroen@terena.nl> wrote : > I guess I'm sidetracking from the original issue! oh wel...Another question > ;-) I > really like HTML:Quickform, it saves me lots of work. Is there any way to use > this > with Smarty or PEAR templates, so the presentation is part of the template for > the > page that contains the form? In the examples, the presentation is mixed with > the > element creation statements e.g. > > $form->setElementTemplate("<!--BEGIN required myHTML blah"); > $form->addElement("text".....); I will implement this as soon as I get some time to play with it. My idea, as suggested by Stig some weeks ago, is to pass a template object to the QuickForm object. My concern is what the template will look like. There are two solutions I can think of. 1. Let the designer define placeholders for all form elements as if he was actually making the form in his wysiwyg application. - How to name the placeholders ? - How to describe styles to use for required, errors, labels, inputs. 2. Use a few reusable blocks and let QuickForm know which block is used to display which element. The first solution is easier to implement while the second one is for lazy designers like me. I will probably end up doing both as I need the second one anyway for an app I develop. I still need to think about it a bit. Anyway, only a bridge to HTML_Template_IT will be implemented in the beginning. It's too bad that all template systems don't have a common API. If you have any suggestions, please let me know. Thanks, Bertrand Mansion Mamasam

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