Neos\FluidAdaptor\View\AbstractTemplateView::renderStandaloneSection PHP Method

renderStandaloneSection() protected method

In this case, we just emulate that a surrounding (empty) layout exists, and trigger the normal rendering flow then.
protected renderStandaloneSection ( string $sectionName, array $variables = [], boolean $ignoreUnknown = false ) : string
$sectionName string Name of section to render
$variables array The variables to use
$ignoreUnknown boolean Ignore an unknown section and just return an empty string
return string rendered template for the section
    protected function renderStandaloneSection($sectionName, array $variables = [], $ignoreUnknown = false)
    {
        $controllerName = $this->baseRenderingContext->getControllerName();
        $templateParser = $this->baseRenderingContext->getTemplateParser();
        $templatePaths = $this->baseRenderingContext->getTemplatePaths();
        $actionName = $this->baseRenderingContext->getControllerAction();
        $actionName = ucfirst($actionName);
        // Note this is (unfortunately) needed to initialize the template
        $templatePaths->getTemplateSource($controllerName, $actionName);
        $templateIdentifier = $templatePaths->getTemplateIdentifier($controllerName, $actionName);
        $parsedTemplate = $templateParser->getOrParseAndStoreTemplate($templateIdentifier, function ($parent, TemplatePaths $paths) use($controllerName, $actionName) {
            return $paths->getTemplateSource($controllerName, $actionName);
        });
        $parsedTemplate->addCompiledNamespaces($this->baseRenderingContext);
        $this->startRendering(self::RENDERING_LAYOUT, $parsedTemplate, $this->baseRenderingContext);
        $output = $this->renderSection($sectionName, $variables, $ignoreUnknown);
        $this->stopRendering();
        return $output;
    }