Hello !
I have a Dwoo
template - in example base.html
and there is an array $data
.
{assign '' 'globalVar'} {* $globalVar empty right now *}
{foreach $data element}
{include '_partial.html'}
{/foreach}
...
<b>{$globalVar}</b>
And here is _partial.html
<p>
{$element.someText}
</p>
{assign "$globalVar $element.someVar" 'globalVar'}
What I want to gain ? In every partial file I want to modify some $globalVar
that I want to use after {foreach}
.
And here is an important thing - I do not want to do the partial's {assign}
in base.html
! Only in _partial.html
.
Is it possible to pass $globalvar
to _partial.html
by reference so partial file would modify this variable ?