Location: PHPKode > projects > Open Power Template > tests/Opt/instruction/include_4.txt
The variable set for the main view must not be visible in the included view.

>>>>templates/test.tpl
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!-- Include a file -->
<opt:root>
Foo{$variable}
<opt:include file="included.tpl" />
</opt:root>

>>>>templates/included.tpl
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!-- Include a file -->
<opt:root>
Bar{$variable}
</opt:root>

>>>>expected.txt
OUTPUT

>>>>result.txt
FooFooBar
>>>>data.php
$view->variable = 'Foo';
Return current item: Open Power Template