Forums / Developer / loop

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