|
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 |
rafath Smarty n00b
Joined: 16 Jan 2004 Posts: 2
|
Posted: Fri Jan 16, 2004 11:45 am Post subject: unusual key in associative array |
|
|
Hello everybody!
I have one problem 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 |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Fri Jan 16, 2004 12:20 pm Post subject: Re: unusual key in associative array |
|
|
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 |
|
rafath Smarty n00b
Joined: 16 Jan 2004 Posts: 2
|
Posted: Fri Jan 16, 2004 12:40 pm Post subject: Thank U |
|
|
its worked, thank U indeed!
best regards
Rafath |
|
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
|