Location: PHPKode > projects > Open Power Template > tests/Opt/format/spldatastructure_5.txt
Bug #131 - section special variables should be negated without problems.

>>>>templates/test.tpl
<opt:section name="foo">
{$foo.item}:
<opt:if test="not $system.section.foo.last">not last</opt:if>
{$foo.item}:
<opt:if test="not $system.section.foo.first">not first</opt:if>
</opt:section>

>>>>data.php

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

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

>>>>expected.txt
OUTPUT

>>>>result.txt
FOO:not last
FOO:
BAR:not last
BAR:not first
JOE:not last
JOE:not first
GOO:
GOO:not first
Return current item: Open Power Template