mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-09-29 12:49:06 +02:00
BUGFIX: Pass arguments through to subtemplates when rendering those too
This commit is contained in:
parent
e4a043ac0b
commit
21bf409b7b
@ -796,7 +796,10 @@ class SSViewer {
|
||||
if(isset($_GET['debug_profile'])) Profiler::unmark("SSViewer::process - compile", " for $template");
|
||||
}
|
||||
|
||||
$internalArguments = array('I18NNamespace' => basename($template));
|
||||
$templateSpecificGlobals = array('I18NNamespace' => basename($template));
|
||||
$arguments = $arguments ? array_merge($templateSpecificGlobals, $arguments) : $templateSpecificGlobals;
|
||||
|
||||
$subtemplateGlobals = array();
|
||||
|
||||
// Makes the rendered sub-templates available on the parent item,
|
||||
// through $Content and $Layout placeholders.
|
||||
@ -805,11 +808,11 @@ class SSViewer {
|
||||
$subtemplateViewer = new SSViewer($this->chosenTemplates[$subtemplate]);
|
||||
$subtemplateViewer->setPartialCacheStore($this->getPartialCacheStore());
|
||||
|
||||
$internalArguments[$subtemplate] = $subtemplateViewer->process($item);
|
||||
$subtemplateGlobals[$subtemplate] = $subtemplateViewer->process($item, $arguments);
|
||||
}
|
||||
}
|
||||
|
||||
$val = $this->includeGeneratedTemplate($cacheFile, $item, $arguments ? array_merge($internalArguments, $arguments) : $internalArguments);
|
||||
$val = $this->includeGeneratedTemplate($cacheFile, $item, array_merge($subtemplateGlobals, $arguments));
|
||||
$output = Requirements::includeInHTML($template, $val);
|
||||
|
||||
array_pop(SSViewer::$topLevel);
|
||||
|
Loading…
Reference in New Issue
Block a user