Re: Re: QF multiple rows of elements

From: Date: Tue, 27 Apr 2004 13:48:46 +0000
Subject: Re: Re: QF multiple rows of elements
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-12165@lists.php.net to get a copy of this message
<nix@daniu.de> wrote : > > $el[] = &HTML_QuickForm::createElement('text', 'Datum'.$i, > null,''); > $el[] = &HTML_QuickForm::createElement('text', 'Betrag'.$i,null, > ''); > > To get seperate rows you will need to use a renderer like ITStatic. I > am doing this with: > while($i<$max){ > $el[] = &HTML_QuickForm::createElement('static', '','', > '<tr><td>design element'); > $el[] = &HTML_QuickForm::createElement('text', 'Datum'.$i, > null,''); > $el[] = &HTML_QuickForm::createElement('text', 'Betrag'.$i, > null, ''); > } > $this->addGroup($el, 'rows', '', ''); > > Then I can use 'rows' in my template > > But I am not proud about this piece of code ... > I think ITStatic sounds like this is not what is supposed to be done > with it ... (this way I do not have the separation between code and > design anymore which is the main purpose of using templates) If your form is built dynamically (ie. elements are added to it in a non fixed way, as this is the case here because he is using a loop), you should use the dynamic renderers. Bertrand Mansion Mamasam

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