protected function getStoredVariable($viewHelperClassName, $name, $sectionName = NULL)
{
if (TRUE === isset($this->renderedSections[$sectionName])) {
return $this->renderedSections[$sectionName]->get($viewHelperClassName, $name);
}
if (FALSE === $this->controllerContext instanceof ControllerContext) {
throw new \RuntimeException('ExposedTemplateView->getStoredVariable requires a ControllerContext, none exists (getStoredVariable method)', 1343521593);
}
$this->baseRenderingContext->setControllerContext($this->controllerContext);
$this->setRenderingContext($this->baseRenderingContext);
if (isset($this->templateParser)) {
// Note: this is for compatibility with Standalone Fluid as base;
// this package no longer requires this initialisation when rendering sections.
$this->templateParser->setConfiguration($this->buildParserConfiguration());
}
$parsedTemplate = $this->getParsedTemplate();
$this->startRendering(AbstractTemplateView::RENDERING_TEMPLATE, $parsedTemplate, $this->baseRenderingContext);
$viewHelperVariableContainer = $this->baseRenderingContext->getViewHelperVariableContainer();
if (FALSE === empty($sectionName)) {
$this->renderStandaloneSection($sectionName, $this->baseRenderingContext->getTemplateVariableContainer()->getAll());
} else {
$this->render();
}
$this->stopRendering();
if (FALSE === $viewHelperVariableContainer->exists($viewHelperClassName, $name)) {
return NULL;
}
$this->renderedSections[$sectionName] = $viewHelperVariableContainer;
$stored = $viewHelperVariableContainer->get($viewHelperClassName, $name);
return $stored;
}