Typo3 Fluid:elseif 内联符号

Typo3 Fluid: elseif inline notation

下面的例子有内联符号吗?

<f:if condition="{value}==1">
    <f:then>Value is 1</f:then>
    <f:else if="{value}==2">Value is 2</f:else>
</f:if>

感谢您的帮助

您的条件将默认为 'Value is 2' 尽管值可能不是 ... 这不是真的,无论如何更完整:

<f:if condition="{value}==1">
  <f:then>Value is 1</f:then>
  <f:else if="{value}==2">Value is 2</f:else>
  <f:else>Value is not valid</f:else>
</f:if>

如果不满足两个条件,则不输出任何内容的简单内联注释:

{f:if(condition:'{value}==1',
  then: 'Value is 1',
  else: '{f:if(condition:\'{value}==2\',then: \'Value is 2\')}'
)}

在第二个条件中添加else子句:

{f:if(condition:'{value}==1',
  then: 'Value is 1',
  else: '{f:if(condition:\'{value}==2\',
    then: \'Value is 2\',
    else: \'Value is not valid\'
  )}'
)}

可能是if-viewhelpers:

的级联
{f:if(condition:'{value}==1', 
    then:'Value is 1', 
    else:'{f:if(condition:\'{value}=2\', then:\'Value is 2\')}'
)}

具有为堆叠内联视图助手转义字符串定界符的常见缺点。