template syntax for array index

Jake Bunce

XenForo moderator
Staff member
Is there a template equivalent for this?

Code:
$array[$index]
I tried this but it doesn't work:

Code:
{$array.$index}
 

Mike

XenForo developer
Staff member
{$array.{$index}}

Consider:

{$array.$index.x}

Is that {$array.{$index}.x} or {$array.{$index.x}}? The extra curlies resolve the ambiguity.
 
Top