Wednesday 03 November 2010 9:26:39 am
It is somehow possible to access arrays by defining its indexes as variables. The following code is not tested against ez-template and was written straight from mind to keyboard, so make sure to test it.
{def $myarray=array('foo', 'bar', 'hello', 'world')}
{def $index=2}
content from myarray at index {$index} is {$myarray.$index} I'm not aware of a constuct you stated above which works in the ez template language. Perhaps it's not even a good idea to use such construct as you might throw away memory and cannot purge it. It also leaks those created variables (example1, example2, ...) into other templates. Perhaps you should consider to use another solution which is more stable. Perhaps use arrays instead? http://doc.ez.no/eZ-Publish/Technical-manual/4.x/Reference/Template-operators/Arrays cheers, chris
Hannover, Germany
eZ-Certified http://auth.ez.no/certification/verify/395613
|