Re: Re: QF SmartyArray with radio buttons
| From: | Jeroen Houben | Date: | Tue, 27 Jan 2004 13:42:51 +0000 |
| Subject: | Re: Re: QF SmartyArray with radio buttons | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-10381@lists.php.net to get a copy of this message | ||
Thanks Thomas.
I'm sorry I couldn't look at your version of the renderer before, I was very busy at work (still am actually).
Anyway, it seems to work beautifully, I think it is more intuitive this way. I do hope your patch will be included in the next release (I actually thought it would be in 3.2.1) because I cannot really allow myself to use CVS versions.
regards,
Jeroen
Thomas Schulz wrote:
Jeroen Houben wrote in php.pear.general:I'm converting old QF (2.x) code so it can work with QF 3.x and make use of the SmartyArray renderer. I'm a bit puzzled as to why the following code gives me notices. I'm runnig Smarty 2.6 and the latest stable quickform 3.2.1).Hello Jeoren, using the current CVS-Version of ArraySmarty this works, because I test this with your requirements and also send you this reworked Smarty-Render last at the end of november. --- form definition ---- $institution = array('1' => 'First Inst', '2' => 'Second Inst','drei' => 'Third Inst', ); foreach ($institution as $instID => $instName) { $radio = array(); $radio[] = &HTML_QuickForm::createElement('radio', null, null, 'Yes', 'yes'); $radio[] = &HTML_QuickForm::createElement('radio', null, null, 'No', 'no'); $form->addGroup($radio, "conn_allowed[$instID]" ,null, ' '); $form->addElement('text', "conn_marketshare[$instID]",null, array ("size"=>3, "maxlength"=>3)); } --- template ---- {foreach key=key item=radiogroup from=$form.conn_allowed} <p>{$radiogroup.html} {$form.conn_marketshare.$key.html}</p> {/foreach} You can get the CVS-Version here: http://cvs.php.net/co.php/pear/HTML_QuickForm/QuickForm/Renderer/ArraySmart y.php?login=2&r=1.5 ThS.