Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

how to read array when including 'dot' in a key

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
gun_ip
Smarty n00b


Joined: 17 Jul 2003
Posts: 1

PostPosted: Thu Jul 17, 2003 5:18 am    Post subject: how to read array when including 'dot' in a key Reply with quote

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
View user's profile Send private message
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Thu Jul 17, 2003 5:46 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP