‪TYPO3CMS  ‪main
TYPO3\CMS\Fluid\Core\ViewHelper\ViewHelperResolver Class Reference
Inheritance diagram for TYPO3\CMS\Fluid\Core\ViewHelper\ViewHelperResolver:

Public Member Functions

 __construct (ContainerInterface $container, array $namespaces)
 createViewHelperInstanceFromClassName ($viewHelperClassName)

Protected Member Functions

 getBackendUser ()

Protected Attributes

ContainerInterface $container

Detailed Description

Class ViewHelperResolver

Class whose purpose is dedicated to resolving classes which can be used as ViewHelpers and ExpressionNodes in Fluid.

This CMS-specific version of the ViewHelperResolver works almost exactly like the one from Fluid itself, with the main differences being that this one supports a legacy mode flag which when toggled on makes the Fluid parser behave exactly like it did in the legacy CMS Fluid package.

In addition to modifying the behavior or the parser when legacy mode is requested, this ViewHelperResolver is also made capable of "mixing" two different ViewHelper namespaces to effectively create aliases for the Fluid core ViewHelpers to be loaded in the TYPO3\CMS\ViewHelpers scope as well.

Default ViewHelper namespaces are read TYPO3 configuration at:


Extending this array allows third party ViewHelper providers to automatically add or extend namespaces which then become available in every Fluid template file without having to register the namespace.

This is a helper class which is not considered part of TYPO3's Public API.

Definition at line 57 of file ViewHelperResolver.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Fluid\Core\ViewHelper\ViewHelperResolver::__construct ( ContainerInterface  $container,
array  $namespaces 

ViewHelperResolver constructor

Loads namespaces defined in global TYPO3 configuration. Overlays f: with f:debug: when Fluid debugging is enabled in the admin panel, causing debugging-specific ViewHelpers to be resolved in that case.

constructor, use ViewHelperResolverFactory->create() instead

Definition at line 70 of file ViewHelperResolver.php.

References TYPO3\CMS\Fluid\Core\ViewHelper\ViewHelperResolver\$container, $GLOBALS, TYPO3\CMS\Core\Http\fromRequest, and TYPO3\CMS\Fluid\Core\ViewHelper\ViewHelperResolver\getBackendUser().

Member Function Documentation

◆ createViewHelperInstanceFromClassName()

TYPO3\CMS\Fluid\Core\ViewHelper\ViewHelperResolver::createViewHelperInstanceFromClassName (   $viewHelperClassName)

Definition at line 87 of file ViewHelperResolver.php.

◆ getBackendUser()

TYPO3\CMS\Fluid\Core\ViewHelper\ViewHelperResolver::getBackendUser ( )

Member Data Documentation

◆ $container

ContainerInterface TYPO3\CMS\Fluid\Core\ViewHelper\ViewHelperResolver::$container