[Flow] Count table rows in Fluid Template f:for
Bastian Waidelich
bastian at typo3.org
Fri May 8 12:29:13 CEST 2015
On 07.05.15, at 14:45, Patric Eckhart wrote:
Hi Patric,
> I have a order table and a orderposition table.
> The orderpositions are assigned to the orders.
>
> With the for loop I get the orders and with the for loop in it I get the
> orderpositions for the order.
>
> I want to add a static "orderposition" like a sentence e.g. "More than
> one" after the orderpositions if a field in the order table has the same
> values.
> [...]
> You understand?
Not entirely I'm afraid.
I think it helps a lot if you thing in *behaviors* rather than in *data*
and *tables*. And then build a domain model around those behaviors.
For example if you have a model *Order* you could add a method
*hasMoreThanOnePosition()* and you could use that within Fluid like;
<f:if condition="{order.moreThanOnePosition}">
More than one
</f:if>
HTH
--
Bastian Waidelich
More information about the Flow
mailing list