|
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 |
Nibble Smarty n00b
Joined: 22 May 2003 Posts: 1
|
Posted: Thu May 22, 2003 9:02 am Post subject: I have a BIG problem with arrays |
|
|
Hi!
I'm getting crazy with smarty syntax.
If we have an associative index in an array we must use the point separator but if we want to specify an internal index we must use the brackets []. Is this correct?
OK... now... what happens if we have an array with associative indexes in a level and internal indexes in a sub-level ?
Could we do something like Code: | $matrix.links[2].nav_id | ???
answer: NO, or at least I don't know how to make it work. |
|
Back to top |
|
Escariion Smarty Rookie
Joined: 14 May 2003 Posts: 7 Location: Berlin, Germany
|
Posted: Thu May 22, 2003 11:37 am Post subject: |
|
|
i use [$var] for numeric index
and .$var for string index
is this your array:?
Code: |
$matrix = array(
'links'=>array(
2=>array(
'nav_id'
)
)
);
|
|
|
Back to top |
|
Enquest Smarty Regular
Joined: 14 May 2003 Posts: 79
|
Posted: Fri May 23, 2003 7:00 am Post subject: |
|
|
I think it should work...
Could the last replyer tell me how to us $var? |
|
Back to top |
|
Escariion Smarty Rookie
Joined: 14 May 2003 Posts: 7 Location: Berlin, Germany
|
Posted: Fri May 23, 2003 10:01 am Post subject: |
|
|
hm ok use it without $
{$one_var.var}
{$one_var[var]} |
|
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
|