|
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 |
cibouseb Smarty Rookie
Joined: 15 Apr 2004 Posts: 6
|
Posted: Thu Jun 10, 2004 9:06 am Post subject: [Array] Problem with an array |
|
|
Hello,
In tpl file, $obj is an object with val an attribut of this object and val an Integer value, why this is wrong :
Code: |
...
{ $tab[$obj->val] }
...
|
Thank
Seb |
|
Back to top |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Thu Jun 10, 2004 2:31 pm Post subject: |
|
|
That syntax just isn't supported. Within brackets very little is supported, in fact. You will have to use an intermediate:
Code: | {assign var=temp val=$obj->val}
{$tab[$temp]} or {$tab.$temp} |
|
|
Back to top |
|
cibouseb Smarty Rookie
Joined: 15 Apr 2004 Posts: 6
|
Posted: Thu Jun 10, 2004 2:35 pm Post subject: |
|
|
Thanks. it 's ok now with your help.
bye |
|
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
|