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

unusual key in associative 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
rafath
Smarty n00b


Joined: 16 Jan 2004
Posts: 2

PostPosted: Fri Jan 16, 2004 11:45 am    Post subject: unusual key in associative array Reply with quote

Hello everybody!

I have one problem Rolling Eyes with unusal key in associative array:

in php:

$tab = array (
"body" => array ("font-size" => 10, "background-color" => "#fefefe"),
".class" => array ("font-size" => 12, "background-color" => "#000000"),
);

$smarty->assign ("tab", $tab);

Now in smarty I cant read the value of this:
{$tab.body.font-size}

is there any way to read this value?

best regards
Back to top
View user's profile Send private message Visit poster's website
messju
Administrator


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

PostPosted: Fri Jan 16, 2004 12:20 pm    Post subject: Re: unusual key in associative array Reply with quote

rafath wrote:
is there any way to read this value?


only if you assign the key to another variable:
{assign var=key value="font-size"}{$tab.body.$key}
Back to top
View user's profile Send private message Send e-mail Visit poster's website
rafath
Smarty n00b


Joined: 16 Jan 2004
Posts: 2

PostPosted: Fri Jan 16, 2004 12:40 pm    Post subject: Thank U Reply with quote

its worked, thank U indeed!

best regards
Rafath
Back to top
View user's profile Send private message 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