由於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。