public function render()
{
$currentNode = $this->getCurrentNode();
$currentSiteNode = $currentNode->getContext()->getCurrentSiteNode();
$typoScriptRuntime = $this->getTypoScriptRuntime($currentSiteNode);
$dimensions = $currentNode->getContext()->getDimensions();
if (array_key_exists('language', $dimensions) && $dimensions['language'] !== array()) {
$currentLocale = new Locale($dimensions['language'][0]);
$this->i18nService->getConfiguration()->setCurrentLocale($currentLocale);
$this->i18nService->getConfiguration()->setFallbackRule(array('strict' => false, 'order' => array_reverse($dimensions['language'])));
}
$typoScriptRuntime->pushContextArray(array('node' => $currentNode, 'documentNode' => $this->getClosestDocumentNode($currentNode) ?: $currentNode, 'site' => $currentSiteNode, 'editPreviewMode' => isset($this->variables['editPreviewMode']) ? $this->variables['editPreviewMode'] : null));
try {
$output = $typoScriptRuntime->render($this->typoScriptPath);
$output = $this->mergeHttpResponseFromOutput($output, $typoScriptRuntime);
} catch (RuntimeException $exception) {
throw $exception->getPrevious();
}
$typoScriptRuntime->popContext();
return $output;
}