Quickform hierselect: how to use it with smarty
| From: | Damien Cros | Date: | Mon, 10 Apr 2006 16:30:26 +0000 |
| Subject: | Quickform hierselect: how to use it with smarty | ||
| References: | 1 2 3 4 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-23606@lists.php.net to get a copy of this message | ||
Hi,
I'd like to be able to access each element of the hier select in my template.
This would look something like:
{$form.myhs.label}
{$form.myhs.firstSelectElement.html}
<some html>
{$form.myhs.secondElement.html}
I know that you can do it with groups. And HTML_Quickform_hierselect is a child of HTML_Quickform_group. So that should be possible, right?
Here's what I do in my php file:
$myhierselectElement = $form->addElement('hierselect', 'myhs', 'my label');
$hs = $myhierselectElement->getElements();
$hs->setName('firstSelectElement');
the generated name is myhs[firstSelectElement] in the html file.
According to the smarty manual, {$form.myhs['firstSelectElement']} (with or without quote) won't be correct here.
I've tried {$form.myhs.firstSelectElement.html} and {$form.myhs[0].html} (the latter should be correct according to the same manual) but both don't work.
Can you help me?
Thanks,
Damien