Location: PHPKode > projects > Open Power Template > tests/Opt/instruction/component_13.txt
What happens if two components are nested one in another?

>>>>templates/test.tpl
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<opt:root xmlns:opt="http://xml.invenzzia.org/opt">

<opt:component from="$component">
<opt:set name="foo" str:value="bar" />
{$system.component.foo}

<opt:component from="$component2">
<opt:set name="foo" str:value="joe" />
{$system.component.foo}
</opt:component>

</opt:component>

</opt:root>

>>>>data.php

$view->component = new myComponent;
$view->component2 = new myComponent;

>>>>expected.txt
OUTPUT

>>>>result.txt
VIEW PASSED
PARAM foo PASSED
PARAM foo RETURNED
bar
VIEW PASSED
PARAM foo PASSED
PARAM foo RETURNED
joe
Return current item: Open Power Template