[TYPO3-mvc] Access typoscript settings in model

Claus Due claus at wildside.dk
Sun Mar 18 17:03:33 CET 2012


On Mar 18, 2012, at 4:48 PM, Stephen Bungert wrote:

> Does this mean, that maybe I'm trying to do something in the wrong place? I think viewhelpers can access settings right? Should I try and do what I'm doing in a vh?

Hi Stephen,

It probably means what you are trying to do should be part of the View - if you can, then solve it using conditions and output of {settings.someVariable} (which is already available in your template). If you can't solve it this way a ViewHelper is a good option - perhaps one that will accept the specific settings you have in {settings.*} to configure how it processes an instance of a Model object, for example.

Another option is in your Controller but that's usually not the place to manipulate your Model before displaying it. Which is what I assume you want to do, in which case template variables and ViewHelpers are the better choice :)

--
Cheers,
Claus
http://fedext.net


More information about the TYPO3-project-typo3v4mvc mailing list