php - Generating {$num} inside {foreach} -


I am working on a smart template.

I should have a number in my list array

then I tried

{foreach} {$ num} {/ foreach}

Which prints 0 1 2 3 4 5 ........

I want my numbers to begin with 1 Become; 0

How do I get it?

OR

Is there any other way

thanks

{Foreach} {$ num | Assign: $ num + 1} {$ num} {/ foreach}

or

{foreach} {assign var = new value = $ num + 1} {$ newnum} {/ foreach}


Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -