[TYPO3-mvc] fluid: object.accessor and method with arguments

Franz Koch typo3.RemoveForMessage at elements-net.de
Mon Mar 29 11:25:53 CEST 2010


Hi Peter,

> I assign my Object to the view. Now I would like to call method on the
> object within the fluid-template and hand over a parameter to the method.
...
> Implementing a ViewHelper for this seems not the right way to me, as
> this doen't belong to the view but to the model/business logic.

Why not?
<f:format.price price="{yourObject.totalPriceForConsumption}" 
units="{units}" colorize="true" />

Your viewHelper could f.e. then also take care of the correct coloring 
(f.e. if you also have negative prices/coupons that should be colored 
red). The viewHelper can also take care of the correct position of the 
unit/currency sign, f.e. $3.99 -> 3,99 €.
And if you don't want to put some domain logic inside a viewHelper, let 
the viewHelper call a domain service.
-- 
kind regards,
Franz Koch


More information about the TYPO3-project-typo3v4mvc mailing list