loop

Author Message

asdsad asdsadsa

Monday 13 September 2004 1:09:59 am

How will look this in ez template language:

<?php
for($i=10;$i<20;$i++)
{
    // do something
}
?>

Sorry for my english :-)

Ole Morten Halvorsen

Monday 13 September 2004 2:01:25 am

If you want to loop 10 times:

{section loop=10}
     {* do something *}
{/section}

Ole M.

Senior Software Engineer - Vision with Technology

http://www.visionwt.com
http://www.omh.cc
http://www.twitter.com/omh

eZ Certified Developer
http://ez.no/certification/verify/358441
http://ez.no/certification/verify/272578

asdsad asdsadsa

Monday 13 September 2004 4:08:15 am

ok, but i must do something like this:

<?php
for($i=2000;$i<2004;$i++)
{
    // the years above actualy are variables....
    itteration year
    print $i;
}
?>

Ole Morten Halvorsen

Monday 13 September 2004 4:35:33 am

Ok, try this instead:

{let year1=2000
     year2=2004}

{section loop=sub( $year2, $year1 )}
    {* do something here...*}
{/section}

Ole M.

Senior Software Engineer - Vision with Technology

http://www.visionwt.com
http://www.omh.cc
http://www.twitter.com/omh

eZ Certified Developer
http://ez.no/certification/verify/358441
http://ez.no/certification/verify/272578

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 19:07:48
Script start
Timing: Jan 18 2025 19:07:48
Module start 'layout'
Timing: Jan 18 2025 19:07:48
Module start 'content'
Timing: Jan 18 2025 19:07:48
Module end 'content'
Timing: Jan 18 2025 19:07:48
Script end

Main resources:

Total runtime0.0196 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.0068 589.1172152.5938
Module start 'layout' 0.00680.0027 741.710939.3750
Module start 'content' 0.00960.0077 781.085989.1953
Module end 'content' 0.01730.0023 870.281334.3047
Script end 0.0196  904.5859 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002512.7123140.0002
Check MTime0.00126.0399140.0001
Mysql Total
Database connection0.00104.902610.0010
Mysqli_queries0.003115.691030.0010
Looping result0.00000.065510.0000
Template Total0.00188.910.0018
Template load0.00094.556710.0009
Template processing0.00094.338210.0009
Override
Cache load0.00063.003010.0006
General
dbfile0.002412.319080.0003
String conversion0.00000.040140.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