‪TYPO3CMS  ‪main
TYPO3\CMS\Fluid\Core\Rendering\RenderingContextFactory Class Reference

Public Member Functions

 __construct (private readonly ContainerInterface $container, private readonly CacheManager $cacheManager, private readonly ViewHelperResolverFactoryInterface $viewHelperResolverFactory,)
 create (array $templatePathsArray=[])

Detailed Description

Factory class registered in ServiceProvider to create a RenderingContext.

This is a low level factory always registered, even in failsafe mode: fluid is needed in install tool which does not rely on the normal (cached) symfony DI mechanism - Services.yaml is ignored in failsafe mode.

A casual failsafe instantiation / injection using ServiceProvider.php wouldn't need this factory. But the failsafe mechanism is strict and relies on two things: The service is public: true, this is the case with RenderingContext. And the service is shared: true - a stateless singleton. This is not true for RenderingContext, it by definition relies on context and must be created a-new per fluid parsing instance.

To allow creating RenderingContext objects in failsafe mode, this factory is registered as service provider to dynamically prepare instances.

May change / vanish any time

Definition at line 50 of file RenderingContextFactory.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Fluid\Core\Rendering\RenderingContextFactory::__construct ( private readonly ContainerInterface  $container,
private readonly CacheManager  $cacheManager,
private readonly ViewHelperResolverFactoryInterface  $viewHelperResolverFactory 

Definition at line 52 of file RenderingContextFactory.php.

Member Function Documentation

◆ create()

TYPO3\CMS\Fluid\Core\Rendering\RenderingContextFactory::create ( array  $templatePathsArray = [])

Definition at line 58 of file RenderingContextFactory.php.

References $GLOBALS.