20 use TYPO3\CMS\Fluid\Core\Cache\FluidTemplateCache;
24 use TYPO3Fluid\Fluid\Core\Compiler\TemplateCompiler;
25 use TYPO3Fluid\Fluid\Core\Parser\Configuration;
26 use TYPO3Fluid\Fluid\Core\Parser\TemplateParser;
27 use TYPO3Fluid\Fluid\Core\Variables\StandardVariableProvider;
28 use TYPO3Fluid\Fluid\Core\ViewHelper\ViewHelperInvoker;
29 use TYPO3Fluid\Fluid\Core\ViewHelper\ViewHelperVariableContainer;
30 use TYPO3Fluid\Fluid\View\ViewInterface;
49 $this->viewHelperVariableContainer = $viewHelperVariableContainer;
61 parent::__construct($view);
65 $this->setTemplateParser(
new TemplateParser());
66 $this->setTemplateCompiler(
new TemplateCompiler());
67 $this->setViewHelperInvoker(
new ViewHelperInvoker());
68 $this->setViewHelperVariableContainer(
new ViewHelperVariableContainer());
69 $this->setVariableProvider(
new StandardVariableProvider());
72 $objectManager = GeneralUtility::makeInstance(ObjectManager::class);
73 $this->setTemplateProcessors(array_map([$objectManager,
'get'],
$GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'fluid'][
'preProcessors']));
74 $this->setExpressionNodeTypes(
$GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'fluid'][
'expressionNodeTypes']);
75 $this->setTemplatePaths($objectManager->get(TemplatePaths::class));
76 $this->setViewHelperResolver($objectManager->get(ViewHelperResolver::class));
79 $cache = $objectManager->get(CacheManager::class)->getCache(
'fluid_template');
80 if (is_a(
$GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'caching'][
'cacheConfigurations'][
'fluid_template'][
'frontend'], FluidTemplateCache::class,
true)) {
81 $this->setCache($cache);
93 $parserConfiguration = parent::buildParserConfiguration();
94 if (!empty(
$GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'fluid'][
'interceptors'])) {
95 foreach (
$GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'fluid'][
'interceptors'] as $className) {
96 $interceptor = GeneralUtility::makeInstance($className);
98 throw new \InvalidArgumentException(
'Interceptor "' . $className .
'" needs to implement ' . InterceptorInterface::class .
'.', 1462869795);
100 $parserConfiguration->addInterceptor($interceptor);
104 return $parserConfiguration;
122 $dotPosition = strpos($action,
'.');
123 if ($dotPosition !==
false) {
124 $action = substr($action, 0, $dotPosition);
126 parent::setControllerAction($action);
127 $this->controllerContext->getRequest()->setControllerActionName(lcfirst($action));
136 parent::setControllerName($controllerName);
137 $this->controllerContext->getRequest()->setControllerName($controllerName);
152 $controllerName = $request->getControllerName();
153 if ($request->getControllerSubpackageKey() && !strpos($controllerName,
'\\')) {
154 $this->
setControllerName($request->getControllerSubpackageKey() .
'\\' . $controllerName);