fenom/docs/en/tags/cycle.md

15 lines
236 B
Markdown
Raw Normal View History

2013-02-13 18:51:53 +04:00
Tag {cycle}
===========
2016-04-12 12:28:57 +03:00
`{cycle}` is used to alternate a set of values.
2013-02-19 09:51:33 +04:00
```smarty
2016-04-12 12:28:57 +03:00
{foreach 1..10}
2013-02-19 09:51:33 +04:00
<div class="{cycle ["odd", "even"]}">
2016-04-12 12:28:57 +03:00
{/foreach}
2013-02-19 09:51:33 +04:00
2016-04-12 12:28:57 +03:00
{foreach 1..10}
2013-02-19 09:51:33 +04:00
<div class="{cycle ["odd", "even"] index=$i}">
2016-04-12 12:28:57 +03:00
{/foreach}
2013-02-19 09:51:33 +04:00
```