ViewHelperResolver extends 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.
This is a helper class which is not considered part of TYPO3's Public API.
Table of Contents
Properties
- $container : ContainerInterface
Methods
- __construct() : mixed
- ViewHelperResolver constructor
- createResolverDelegateInstanceFromClassName() : ViewHelperResolverDelegateInterface
- Creates a ViewHelperResolver delegate object based on a ViewHelper namespace string. The logic here is: If a ViewHelper namespace is defined with an existing class name, that class will be responsible for resolving the ViewHelpers in that namespace (= it is a ViewHelperResolver delegate). If no such class exists, the default ViewHelper resolving is used (implemented in ViewHelperCollection).
- createViewHelperInstanceFromClassName() : ViewHelperInterface
- getBackendUser() : BackendUserAuthentication|null
Properties
$container
protected
ContainerInterface
$container
Methods
__construct()
ViewHelperResolver constructor
public
__construct(ContainerInterface $container, 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
- $namespaces : array<string|int, mixed>
constructor, use ViewHelperResolverFactory->create()
instead
createResolverDelegateInstanceFromClassName()
Creates a ViewHelperResolver delegate object based on a ViewHelper namespace string. The logic here is: If a ViewHelper namespace is defined with an existing class name, that class will be responsible for resolving the ViewHelpers in that namespace (= it is a ViewHelperResolver delegate). If no such class exists, the default ViewHelper resolving is used (implemented in ViewHelperCollection).
public
createResolverDelegateInstanceFromClassName(string $delegateClassName) : ViewHelperResolverDelegateInterface
The default implementation by Fluid is extended to support dependency injection in ViewHelperResolver delegates.
Parameters
- $delegateClassName : string
Return values
ViewHelperResolverDelegateInterfacecreateViewHelperInstanceFromClassName()
public
createViewHelperInstanceFromClassName(string $viewHelperClassName) : ViewHelperInterface
Parameters
- $viewHelperClassName : string
Return values
ViewHelperInterfacegetBackendUser()
protected
getBackendUser() : BackendUserAuthentication|null