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