Re: HTML_QuickForm - templates and the method process()

From: Date: Mon, 11 Nov 2002 22:25:25 +0000
Subject: Re: HTML_QuickForm - templates and the method process()
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-2699@lists.php.net to get a copy of this message
<tipsen@imada.sdu.dk> wrote : > Hi > > I've tried using the HTML_QuickForm class and encountered a few problems: > > 1. If I want to change the templates used for rendering the form in html > should I change the contents of the variables in QuickForm.php or are > there any official/correct way of doing this? There are different ways to use form templates: 1. use setElementTemplate, setFormTemplate, set...Template methods. 2. use setElementTemplate with the second argument set too so that your template will only be set for the element passed as parameter. 3. override with your own form subclass. The prefered ways are 1 and 2. With the soon to come release, you will also have the possibility to change grouped elements templates... > 2. I'm planning on using QuickForm on different pages requiring > different processing of the forms - how am I supposed to treat the > process() method - are there any ways of overriding it from the script > using QuickForm or should I modify the method directly in QuickForm.php? Don't modify the methods in QuickForm directly. Write your own subclass or process FUNCTION (as opposed to METHOD) and pass it the result of $form->getSubmitValues() method. Hope this helps, Bertrand Mansion Mamasam

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