[TYPO3-mvc] Passing filters by array or custom object? Which is the better approach?

Franz Koch typo3.RemoveForMessage at elements-net.de
Mon Jan 11 15:15:41 CET 2010


Hi,

> I want the list action to take all the products out of the repository
> which match the passed filter criteria (given with $filter).
>
> Now I'm not sure about how to build up my filters the best way.
>
> First I thought about passing them as a hash-array - but I don't know
> how to create arrays inside a fluid template. Is this possible?
>
> Second try would be to create a special class for the Filters, which
> stores all filter options, and pass them as an object - would this be
> a better solution, or does this create a too big overhead?
>
> How would you realize that?

why don't you apply the filter already in your repository and only 
return back those objects that match the filters? That's what I would do 
(and do in my ext).

-- 
kind regards,
Franz Koch


More information about the TYPO3-project-typo3v4mvc mailing list