ViewHelperResolver extends ViewHelperResolver

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:

$GLOBALS['TYPO3_CONF_VARS']['SYS']['fluid']['namespaces']

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.

Internal

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

Table of Contents

Properties

$container  : ContainerInterface
$objectManager  : ObjectManagerInterface

Methods

__construct()  : mixed
ViewHelperResolver constructor
createViewHelperInstanceFromClassName()  : ViewHelperInterface
getBackendUser()  : BackendUserAuthentication|null

Properties

$container

protected ContainerInterface $container

Methods

__construct()

ViewHelperResolver constructor

public __construct(ContainerInterface $container, ObjectManagerInterface $objectManager, array<string|int, mixed> $namespaces) : mixed

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.

Parameters
$container : ContainerInterface
$objectManager : ObjectManagerInterface
$namespaces : array<string|int, mixed>
Internal

constructor, use ViewHelperResolverFactory->create() instead

createViewHelperInstanceFromClassName()

public createViewHelperInstanceFromClassName(string $viewHelperClassName) : ViewHelperInterface
Parameters
$viewHelperClassName : string
Return values
ViewHelperInterface

        
On this page

Search results