[TYPO3-mvc] Checkbox Array Fluid - Foreach
Christian Schwan - Dimme GmbH
christian.schwan at dimme.ch
Mon Jun 7 01:34:47 CEST 2010
He guys,
i got a problem with Checkbox Inputs:
my Template looks like
<f:for each="{flooring}" as="value">
<f:form.checkbox value="{value.uid}" name="search[flooring][{value.uid}]" />
</f:for>
Now I have in my Controller
$this->view->assign('post', $this->vars['search']);
The will return the array
Array ( [flooring] => Array ( [1] => 1 [2] => 2 ) )
<f:if condition="{post.flooring}">
<f:then>
<f:for each="{post.flooring}" as="vars">
<f:if condition="{vars} == {value.uid}">
<div class="checkbox"><f:form.checkbox checked="true"
value="{value.uid}" name="search[flooring][{value.uid}]" />
{value.title}</div>
</f:if>
</f:for>
</f:then>
<f:else>
<div class="checkbox"><f:form.checkbox value="{value.uid}"
name="search[flooring][{value.uid}]" /> {value.title}</div>
</f:else>
</f:if>
But in the Condition I should check if the {post.flooring} + {value.uid}
By manually adding {post.flooring.1} == {value.uid}.
{{post.flooring}.{value.uid}} is not possible;-(
How can I render it right?
Christian
More information about the TYPO3-project-typo3v4mvc
mailing list