For Programmers: Free Programming Magazines  


Home > Archive > PHP Pear > April 2006 > Quickform hierselect: how to use it with smarty









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Quickform hierselect: how to use it with smarty
Damien Cros

2006-04-10, 7:00 pm

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
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com