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

Array in an array

 
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 -> Tips and Tricks
View previous topic :: View next topic  
Author Message
san
Smarty n00b


Joined: 14 Apr 2004
Posts: 3
Location: Germany

PostPosted: Thu Apr 15, 2004 7:55 am    Post subject: Array in an array Reply with quote

How do I translate the following to smarty?
$some_array[$array_in_an_array[$the_interesting_object]]['value']

thanks!
San.
Back to top
View user's profile Send private message Visit poster's website
san
Smarty n00b


Joined: 14 Apr 2004
Posts: 3
Location: Germany

PostPosted: Thu Apr 15, 2004 11:49 am    Post subject: Reply with quote

After trying some stuff I found that the following works:

{assign var="temp" value=$some_array.$array_in_an_array.$the_interesting_object}

{$temp.value}

Is there a faster (one statement) way to do this?
Back to top
View user's profile Send private message Visit poster's website
electr0`n
Guest





PostPosted: Thu Apr 15, 2004 4:49 pm    Post subject: Reply with quote

{$some_array.$array_in_an_array.$the_interesting_object.value} should work.
Back to top
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Thu Apr 15, 2004 5:51 pm    Post subject: Reply with quote

electr0`n wrote:
{$some_array.$array_in_an_array.$the_interesting_object.value} should work.


it shouldn't. it would give

$some_array[$array_in_an_array][$the_interesting_object]['value']
but he wants
$some_array[$array_in_an_array[$the_interesting_object]]['value']
Back to top
View user's profile Send private message Send e-mail Visit poster's website
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 -> Tips and Tricks 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