[TYPO3-mvc] How to return a filtered subset of child objects?

Sebastian Kurfürst sebastian at typo3.org
Sat Feb 13 17:35:41 CET 2010


Hi Thomas,

> The problem ist, that I assign the category directly, and
> fluid will just call getProducts based on the markup:

> <f:for each="{category.products}" as="product"/>
> 
> Or do you recommend to assign the products seperately, like:
> 
> $this->view->assign('desiredProducts',
> $this->productRepository->findByCriteria($category, $filters));
I guess that is what I would do, if that works in your case.

> This way I could only assign filtered products by the controller,
> while the category model will always return all assigned products.
Yes, make sure to enable lazy loading in the category model.

Greets,
Sebastian


More information about the TYPO3-project-typo3v4mvc mailing list