Neos\Fusion\Core\Runtime::render PHP Метод

render() публичный Метод

Compared to $this->evaluate, this adds some more comments helpful for debugging.
public render ( string $typoScriptPath ) : string
$typoScriptPath string
Результат string
    public function render($typoScriptPath)
    {
        try {
            $output = $this->evaluateInternal($typoScriptPath, self::BEHAVIOR_EXCEPTION);
            if ($this->debugMode) {
                $output = sprintf('%1$s<!-- Beginning to render TS path "%2$s" (Context: %3$s) -->%4$s%1$s<!-- End to render TS path "%2$s" (Context: %3$s) -->', chr(10), $typoScriptPath, implode(', ', array_keys($this->getCurrentContext())), $output);
            }
        } catch (SecurityException $securityException) {
            throw $securityException;
        } catch (\Exception $exception) {
            $output = $this->handleRenderingException($typoScriptPath, $exception);
        }
        return $output;
    }

Usage Example

 /**
  * 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;
 }