cycle

1.0 1.1 1.2 1.3

Cycles between several values and returns one of them on each call

<?php
cycle([ string $name = 'default', [ mixed $values = null, [ bool $print = true, [ bool $advance = true, [ string $delimiter = ',', [ string $assign = null, [ bool $reset = false ]]]]]]])

Examples

Example #1

index.tpl
{cycle values=array("1red","2blue","3green")}
{cycle}
{cycle advance=false}
{cycle}
{cycle}
{cycle}
{cycle reset=true}

The above example will output:

1red
2blue
3green
3green
1red
2blue
1red