Robbo
Well-known member
The way <xen:set> is compiled sets the var specified to '' straight away. Is there any chance a $compileVar can be used instead and after the contents of the <xen:set> set it to whatever var was?
The reason for this is I couldn't work out why this code was giving me 2 every time.
Using a temp var while processing the contents would mean you could use the var within those contents if it exists and be handy for things like my example. I have to do this instead...
More code, harder to read etc.
Just sharing my annoyance and what would have stopped it from occurring.
The reason for this is I couldn't work out why this code was giving me 2 every time.
Code:
<xen:set var="$row"><xen:if is="{$row} == 2">1<else />2</xen:if></xen:set>
Using a temp var while processing the contents would mean you could use the var within those contents if it exists and be handy for things like my example. I have to do this instead...
Code:
<xen:if is="{$row} == 2"><xen:set var="$row">1</xen:set><xen:else /><xen:set var="$row">2</xen:set></xen:if>
More code, harder to read etc.
Just sharing my annoyance and what would have stopped it from occurring.
Upvote
0