Location: PHPKode > projects > Open Power Template > tests/Opt/format/spldatastructure_7.txt
SplDatastructure format and stacks

>>>>templates/test.tpl
<opt:root>
<opt:section name="foo">
{$foo.item}
</opt:section>
NEXT:
<opt:section name="foo" order="desc">
{$foo.item}
</opt:section>
</opt:root>

>>>>data.php

$spl1 = new SplStack;
$spl1->push(array('item' => 'FOO'));
$spl1->push(array('item' => 'BAR'));
$spl1->push(array('item' => 'JOE'));

$view->foo = $spl1;
$view->setFormat('foo', 'SplDatastructure');

>>>>expected.txt
OUTPUT

>>>>result.txt
JOE
BAR
FOO
NEXT:
FOO
BAR
JOE
Return current item: Open Power Template