/** * Render the view * * @return string The rendered view * @api */ public function render() { $this->initializeTypoScriptRuntime(); if ($this->typoScriptRuntime->canRender($this->getTypoScriptPathForCurrentRequest()) || $this->fallbackViewEnabled === false) { return $this->renderTypoScript(); } else { return $this->renderFallbackView(); } }
/** * Is it possile to render $node with $typoScriptPath? * * @param \TYPO3\TYPO3CR\Domain\Model\NodeInterface $node * @param string $typoScriptPath * @return boolean TRUE if $node can be rendered at $typoScriptPath */ public function canRenderWithNodeAndPath(\TYPO3\TYPO3CR\Domain\Model\NodeInterface $node, $typoScriptPath) { $currentSiteNode = $this->nodeRepository->getContext()->getCurrentSiteNode(); // TODO: find closest folder node from this node... $closestFolderNode = $node; $typoScriptConfiguration = $this->typoScriptService->getMergedTypoScriptObjectTree($currentSiteNode, $closestFolderNode); $typoScriptRuntime = new \TYPO3\TypoScript\Core\Runtime($typoScriptConfiguration, $this->controllerContext); return $typoScriptRuntime->canRender($typoScriptPath); }
/** * Post-Processor which is called whenever this object is encountered in a Fluid * object access. * * Evaluates TypoScript objects and eel expressions. * * @return TypoScriptPathProxy|mixed */ public function objectAccess() { if (!$this->tsRuntime->canRender($this->path)) { return $this; } try { return $this->tsRuntime->evaluate($this->path, $this->templateImplementation); } catch (\Exception $exception) { return $this->tsRuntime->handleRenderingException($this->path, $exception); } }