Re: QF with Smarty
| From: | Thomas Schulz | Date: | Fri, 14 Nov 2003 16:57:56 +0000 |
| Subject: | Re: QF with Smarty | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-8949@lists.php.net to get a copy of this message | ||
Stephan Wentz wrote in php.pear.general:
> I'm trying now for 2 hours to get this working, am I missing something?
> The goal is to have 3 Radio Buttons, not in a row but placed each on a
> different location.
>
> <php>
> $pic1[] = &HTML_QuickForm::createElement('radio', null, null, 'No Pic',
> 'no');
> $pic1[] = &HTML_QuickForm::createElement('radio', null, null, 'Upload
> Pic', 'upload');
> $pic1[] = &HTML_QuickForm::createElement('radio', null, null, 'Use
> existing', 'use');
> $form->addGroup($pic1, 'pic1', 'Picture 1:');
> </php>
>
> Now if I want to output every RadioButton in a Smarty Template, how can
> i manage to output every Radiobutton-Element directly, not the whole
> group?
>
> {$form.pic1.html} works of course, but how can i access the
> radio-element? {$form.pic1.no.html} doesn't work, {$form.pic1.0.html}
> doesn't work, too.
If you want to access the elements inside a group directly, you currently
must give them a name. But this works not as expected with a grouped
radio elements because an element name "destroys" the group behavior in
the rendered html.
Please file this as Bug.
http://pear.php.net/bugs/report.php?package=HTML_QuickForm
We can try to make {$form.pic1.0.html} working, but somthing like
{$form.pic1.no.html} should then also work. Maybe by using the value or
unset the name...
As an Workaround: Have you played with an array of different separators?
$form->addGroup($pic1, 'pic1', 'Picture 1:', array(' ',
'<br />'));
ThS.
--
http://4bconsult.de