[TYPO3-mvc] Fluid - using an array in condition?

Stefan Isak stefanisak at googlemail.com
Mon May 10 16:35:22 CEST 2010


Hello,

is it possible to use the index of an for each tag in a condition?

What I did:

$this->view->assign('checkedItems', array(..));
$this->view->assign('items', $items);

<f:for each="{items}" as="item" key="index">
  <f:if condition="{checkedItems.index}">
    <f:then>
      <f:form.checkbox ... checked="checked" />
    </f:then>
    <f:else>
      <f:form.checkbox  checked="" />
    </f:else>
  </f:if>
</f:for>

But it seems that "{checkedItems.index}" is not equivalent to
{checkedItems.0}, {checkedItems.1}, ...
Is there another syntax, or is it not possible?

Thanks for any advice.
Stefan


More information about the TYPO3-project-typo3v4mvc mailing list