[TYPO3-mvc] Get Controllers settings in viewhelper
Steffen Müller
typo3 at t3node.com
Fri Mar 7 22:18:15 CET 2014
Hi.
Am 06.03.2014 10:42, schrieb Philipp Wrann:
>
>
> But is it possible to get the settings from the controllerContext in the
> viewHelper without passing it?
> I have a few hundered views and most of them contain multiple
> viewhelpers where i want to access those settings, i dont want to adjust
> all views, is there a way to do something like this within a fluid
> viewhelper:
>
> $this->controllerContext->getSettings()?
Forget about controllerContext in your view. The view does not know
about ControllerContext. Don't couple it.
Inject TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface and
fetch settings using getConfiguration()
Find a 4.x example here:
http://forge.typo3.org/projects/typo3v4-mvc/wiki/ConfigurationManager_rework
--
cheers,
Steffen
TYPO3 Blog: http://www.t3node.com/
Twitter: @stmllr - http://twitter.com/stmllr
More information about the TYPO3-project-typo3v4mvc
mailing list