由于TYPO3 8LTS
从版本8 TYPO3使用的流体的独立版本,这是大量开发并得到了大量新功能,如elseif
:
<f:if condition="{var} == 'something'">
<f:then>do something</f:then>
<f:else if="{other-var} == 'something else'">do something else</f:else>
<f:else>do the other thing</f:else>
</f:if>
此外,还有像语法的支持这样的:
<f:if condition="{something} || {someOtherThing}">
Something or someOtherThing
</f:if>
直到并包括TYPO3 7LTS
用普通流体可以嵌套两个if视图助手:
<f:if condition="{var} == 'something'">
<f:then>
// do something
</f:then>
<f:else>
<f:if condition="{other-var} == 'something else'">
<f:then>
// do something else
</f:then>
<f:else>
// do then the other thing
</f:else>
</f:if>
</f:else>
</f:if>
或者你也可以实现自己的视图助手或使用视图助手库一样,有一个视图助手,这是否更优雅VHS。