I ask for the help of experts and just good people. Could you tell me how to implement this?

for ($i = 1; $i <= 10; $i++) { echo $i; } 

On Smarty. That's it, to be able to set the number of repetitions and ways to increase or decrease. And the ability to set the starting point. I would be grateful for any information.

  • The documentation, apparently, did not try to read .. Or do not know how .. - Photon

2 answers 2

{section}, {sectionelse}

 {section name=foo start=10 loop=20 step=2} {$smarty.section.foo.index} {/section} <hr /> {section name=bar loop=21 max=6 step=-2} {$smarty.section.bar.index} {/section} 

something like that :-) yes?

  • one
    In! Buddy, thank you so much) Rescued) - Rimon
  • and why is this smarti so convenient for you? - mountpoint
  • one
    @mountpoint to all. Starting from the fact that it is embedded in the html code and ending with the fact that I wrote the compiler under js. - lampa
  • @lampa, well, this is a matter of taste. How many already work on the web, I do not digest smarti - mountpoint
  • one
    @lampa, I prefer hardcore: a mix of puff and html - mountpoint
 <table width=100%> <tr> {foreach name=inner key=key item=item from=$customer} <td>{$key|capitalize}</td> {/foreach} <tr></table> 
  • So what? Does this suit you according to what I asked for? If so, could you spend a few more seconds telling me how to set the beginning and end of the cycle? - Rimon