RE: [PEAR] Heterogeneous element types in AddGroup?
| From: | Andy Kalinowitsch | Date: | Thu, 12 Jun 2003 14:38:37 +0000 |
| Subject: | RE: [PEAR] Heterogeneous element types in AddGroup? | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-5917@lists.php.net to get a copy of this message | ||
Hi Alexey,
I am using Smarty, and am trying to access the heterogeneous group with the
following (in the .tpl file):
{foreach item=cf from=$form.custom_fields.elements}
{$cf.name}:{$cf.html}<br>
{/foreach}
(after instantiating smarty and passing the form as $smarty->assign('form',
$renderer->toArray()); )
I am able to access all of the other QF elements in the smarty template,
except for this particular group. When I do a var_dump("$form"), I see that
the ["_elements"] array has all 3 elements in it (I was misled because
print_r() uses [fields]), but I don't know how to access it ...
Thanks,
Andy
-----Original Message-----
From: Alexey Borzov [mailto:borz_off@cs.msu.su]
Sent: Thursday, June 12, 2003 7:05 AM
To: Andy Kalinowitsch
Cc: 'pear-general@lists.php.net'
Subject: Re: [PEAR] Heterogeneous element types in AddGroup?
Hi!
Andy Kalinowitsch wrote:
> When I inspect the custom_fields object (in code, or with print_r), its
> [fields] array only has one element (the last one processed):
>
> [custom_fields] => Array
> (
> [fields] => Array
Please show the code you use to 'inspect the custom_fields object'. I looked
through QuickForm's source and 'fields' array index is used nowhere (Array
renderer uses 'elements' and works OK), so I suspect you have a bug
somewhere in
your own code used to build this array.