array handling

Author Message

Pascal France

Thursday 27 September 2007 2:24:23 am

Hi,

Here is my while loop:

{def $tableau=array()
     $i=0
     $NbImages=2}
{while lt($i,$NbImages)}
     {I want $i element of $tableau =$publicites.0.children[$i].data_map.image.content[original].url|ezroot}
{/while}

I don't know how to add the values into $tableau

Pascal

Ce qui embellit le désert c'est qu'il cache un puits... quelque part... (A. de Saint-Exupéry) - http://luxpopuli.fr/eZ-Publish

Łukasz Serwatka

Thursday 27 September 2007 3:16:52 am

Use append() tpl array operator:

Something like:

{set $tableau = $tableau|append( $publicites.0.children[$i].data_map.image.content[original].url|ezroot() )

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Pascal France

Thursday 27 September 2007 1:02:34 pm

Thanks Łukasz.
It works fine.

Pascal

Ce qui embellit le désert c'est qu'il cache un puits... quelque part... (A. de Saint-Exupéry) - http://luxpopuli.fr/eZ-Publish

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.