Jump to content

(solved) smarty issue


Recommended Posts

how can a variable be referenced with another variable in smarty? it's driving me crazy...

{for $i=0;$i<1000;$i++}
<img src='./img/{$images['foo'+$i]['path']}' title='{$images['foo'+$i]['title']}'>
{/for}

seems to return errors.

i also tried some other variants but no luck.

In php it is ${'foo'.$i}

Even tried $$, still no luck

$foo='test';

$a='foo'

$$a should return test

 

 

LE: nevermind, found one that works

$images["foo{$i}"]['path']

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...