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.

eZ debug

Timing: Jan 18 2025 20:56:19
Script start
Timing: Jan 18 2025 20:56:19
Module start 'layout'
Timing: Jan 18 2025 20:56:19
Module start 'content'
Timing: Jan 18 2025 20:56:19
Module end 'content'
Timing: Jan 18 2025 20:56:19
Script end

Main resources:

Total runtime0.0181 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0059 587.7891152.6094
Module start 'layout' 0.00590.0031 740.398439.4297
Module start 'content' 0.00910.0070 779.828189.4141
Module end 'content' 0.01610.0020 869.242234.3047
Script end 0.0181  903.5469 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002413.4492140.0002
Check MTime0.00116.2485140.0001
Mysql Total
Database connection0.00074.010010.0007
Mysqli_queries0.003519.319030.0012
Looping result0.00000.076310.0000
Template Total0.00158.310.0015
Template load0.00084.357310.0008
Template processing0.00073.944310.0007
Override
Cache load0.00052.972410.0005
General
dbfile0.002413.294180.0003
String conversion0.00000.048740.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs