|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
gun_ip Smarty n00b
Joined: 17 Jul 2003 Posts: 1
|
Posted: Thu Jul 17, 2003 5:18 am Post subject: how to read array when including 'dot' in a key |
|
|
I've problem how to read array when including 'dot' in a key like this :
in php :
$a['x.name'];
$smarty->assign('a',$a);
in .tpl :
{$a.x.name} ???????
or
{$a[x.name]} ???????
or
????
Did anyone know how to solve this problem ??? |
|
Back to top |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Thu Jul 17, 2003 5:46 am Post subject: |
|
|
yikes.
The simplest thing I can think of is:
{assign var=temp val="x.name"}
{$a.$temp}
but I can't say I like it much. Is it feasible to instead use underscores in place of dots in your key names? |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|