Location: PHPKode > projects > Open Power Template > tests/Opt/function/cycle_2.txt
Testing the cycle() function with arrays.

>>>>templates/test.tpl
<?xml version="1.0" ?>
<opt:root>
{cycle($cycle)}
{cycle($cycle)}
{cycle($cycle)}
{cycle($cycle)}
{cycle($cycle)}
</opt:root>

>>>>data.php
$view->cycle = array(0 => 'a', 'b', 'c');

>>>>expected.txt
OUTPUT

>>>>result.txt
a
b
c
a
b
Return current item: Open Power Template