/**
  * Render the given TypoScript and return the rendered page
  *
  * @return string
  */
 protected function renderTypoScript()
 {
     $this->typoScriptRuntime->pushContextArray($this->variables);
     try {
         $output = $this->typoScriptRuntime->render($this->getTypoScriptPathForCurrentRequest());
     } catch (RuntimeException $exception) {
         throw $exception->getPrevious();
     }
     $this->typoScriptRuntime->popContext();
     return $output;
 }
예제 #2
0
 /**
  * Renders the view
  *
  * @return string The rendered view
  * @throws \TYPO3\TYPO3\Exception if no node is given
  * @api
  */
 public function render()
 {
     $currentNode = isset($this->variables['value']) ? $this->variables['value'] : NULL;
     if (!$currentNode instanceof \TYPO3\TYPO3CR\Domain\Model\NodeInterface) {
         throw new \TYPO3\TYPO3\Exception('TypoScriptView needs a node as argument.', 1329736456);
     }
     // TODO: find closest folder node from this node...
     $closestFolderNode = $currentNode;
     $currentSiteNode = $this->nodeRepository->getContext()->getCurrentSiteNode();
     $typoScriptObjectTree = $this->typoScriptService->getMergedTypoScriptObjectTree($currentSiteNode, $closestFolderNode);
     $typoScriptRuntime = new Runtime($typoScriptObjectTree, $this->controllerContext);
     $typoScriptRuntime->pushContextArray(array('node' => $currentNode));
     $output = $typoScriptRuntime->render($this->typoScriptPath);
     $typoScriptRuntime->popContext();
     return $output;
 }