Location: PHPKode > projects > Open Power Template > tests/Opt/format/spldatastructure_4.txt
SplDatastructure format: sections and order="desc"
Covers bugs #119 and #120

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

<opt:show name="foo" order="desc">
<p opt:section="foo">{$foo.item}</p>
</opt:show>
</opt:root>

>>>>data.php

$spl1 = new SplDoublyLinkedList;
$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
<p>JOE</p>
<p>BAR</p>
<p>FOO</p>
Return current item: Open Power Template