Forums / General / substitute for {section loop=... construct

substitute for {section loop=... construct

Author Message

Patrick Kaiser

Wednesday 13 July 2005 5:33:46 am

hi,
in the new documentation is stated that the {section -construct should be avoided in the future. since i'm relativly new to ez-publish i'd like to get used to the the 'right' ways of template programming right from the beginning. but i cannot find a way to loop over results from a fetch differently than the old {section loop=... way.

i tried it with 'while' and 'for' statments with no success..

what is best practice for looping over results using the new control structures?

thanks, patrick


Best regards,

Patrick

Frederik Holljen

Wednesday 13 July 2005 5:47:04 am

Use foreach:
{foreach $arrayVar as $variableName}
{$variableName}
{/foreach}