retrieve array elements (smarty)

Discuss PivotX 2.0.x here. Non-PivotX related discussions go in The Drain.

retrieve array elements (smarty)

Postby ruthenoid » Thu Dec 26, 2013 4:35 am

I need to retrieve an array element in my template using smarty.
this is my array:
Code: Select all
[[assign var=foo value=$entry.extrafields.tank|explode:"|"]]

how can I get
Code: Select all
$foo[0]

?
I mean
Code: Select all
[[$foo[0]]]
does not work.
Thanx
ruthenoid
 
Posts: 12
Joined: Mon Jul 12, 2010 8:00 pm

Re: retrieve array elements (smarty)

Postby hansfn » Thu Dec 26, 2013 9:54 am

Code: Select all
[[ $foo.0 ]]
hansfn
Developer
 
Posts: 3278
Joined: Sun Nov 25, 2007 7:48 pm
Location: Molde, Norway

Re: retrieve array elements (smarty)

Postby ruthenoid » Thu Dec 26, 2013 11:02 am

Thank you!
ruthenoid
 
Posts: 12
Joined: Mon Jul 12, 2010 8:00 pm


Return to 2.x Discussion

Who is online

Users browsing this forum: No registered users and 2 guests

cron