如何否定f:如果TYPO3 6.2中的条件?

时间:2018-01-25 07:37:41

标签: typo3 fluid typo3-6.2.x

我有一个TYPO3 6.2实例...是的我知道它已经过时了,我在迁移时并行工作;)

我有 if 声明

<f:if condition="{v:var.get(name: 'access', useRawKeys: 1)}">

有没有办法在TYPO3 6.2.31中否定这个陈述?

提前致谢

2 个答案:

答案 0 :(得分:7)

条件评估在TYPO3 6和7中非常基础:没有notnot - Viewhelper中也没有构建,您可以自己编写。

但您可以轻松使用<f:else> viewhelper,<f:then>不是必需的:

<f:if condition="{v:var.get(name: 'access', useRawKeys: 1)}">
  <f:else>
     : do anything if condition is false
  </f:else>
</f:if>

答案 1 :(得分:1)

你的意思是,如果没有&#34;访问&#34;参数β

<f:if condition="{v:var.get(name: 'access', useRawKeys: 1)}">
   <f:else>
       ###your code if there is no access in the URL##
   </f:else>
</f:if>