[TYPO3-mvc] Accessing fluids viewhelpers

Bastian Waidelich bastian at typo3.org
Sun May 24 23:05:56 CEST 2009


Susanne Moog wrote:

Hi Susanne,

> I'm currently trying to access a fluid viewHelper with:
> $this->variableContainer->get('view')->getViewHelper('Tx_Fluid_ViewHelpers_TranslateViewHelper')

with ViewInterface->getViewHelper() you can obtain MVC view helpers that 
implement the Tx_Extbase_MVC_View_Helper_HelperInterface. They don't 
have anything to do with Fluid view helpers.

We are aware of this misleading naming issue and removed those MVC view 
helpers in FLOW3 (until now, URIHelper was the only view helper - that 
has been replaced by URIBuilder).
I guess, those changes will be backported to extbase soon!


> Can someone point me to the right method?

May I ask why you need to obtain a view helper in your PHP code?
You can simply get it through the objectFactory:

$this->objectFactory->create($viewHelperName);

HTH, Bastian


More information about the TYPO3-project-typo3v4mvc mailing list