Location: PHPKode > projects > Open Power Template > tests/Opt/instruction/extend_11.txt
Check more compound inheritance chains.

>>>>templates/test.tpl
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<opt:extend file="extended1.tpl">
<opt:snippet name="foo">
FOO-VALUE1
</opt:snippet>
</opt:extend>

>>>>templates/extended1.tpl
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<opt:extend file="extended2.tpl" dynamic="yes">
<opt:snippet name="foo">
FOO-VALUE2
</opt:snippet>
<opt:snippet name="goo">
GOO-VALUE2
</opt:snippet>
</opt:extend>

>>>>templates/extended2.tpl
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<opt:root>
BEGIN
<opt:insert snippet="foo" />
<opt:insert snippet="goo" />
END
</opt:root>

>>>>templates/dynamic2.tpl
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<opt:root>
BEGIN-DYNAMIC
<opt:insert snippet="foo" />
<opt:insert snippet="goo" />
END-DYNAMIC
</opt:root>

>>>>expected.txt
OUTPUT

>>>>result.txt
BEGIN-DYNAMIC
FOO-VALUE1
GOO-VALUE2
END-DYNAMIC

>>>>data.php
$view->inherit('extended1.tpl', 'dynamic2.tpl');
Return current item: Open Power Template