|
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 |
TofuWarrior Smarty Rookie
Joined: 05 Jun 2006 Posts: 18
|
Posted: Tue Sep 12, 2006 12:29 pm Post subject: referencing array with variable |
|
|
Hi,
I am sure this must have been answered but couldn't find it. so sorry if this is duplication.
I want to do this.
{$languagesArray.template.chooselanguage[$currentDocument->language]}
Where the language property of currentDocument is an integer.
but I can't get it to work.have tried back ticks and stuff.
What am I doing wrong?
Many Many Thanks to anyone who can help,
TW _________________ We make a living by what we get.
We make a life by what we give. |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
|
Back to top |
|
TofuWarrior Smarty Rookie
Joined: 05 Jun 2006 Posts: 18
|
Posted: Tue Sep 12, 2006 12:52 pm Post subject: |
|
|
Thanks messju,did the job a treat.
SOLUTION:
{assign var=key value=$currentDocument->language}
<h2>{$languagesArray.template.chooselanguage.$key}</h2>
TW _________________ We make a living by what we get.
We make a life by what we give. |
|
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
|