Pass template parameters to parent template
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
parent
d0a6368a8b
commit
0655df09d6
|
@ -206,6 +206,12 @@ class OC_Template extends \OC\Template\Base {
|
||||||
if( $this->renderAs ) {
|
if( $this->renderAs ) {
|
||||||
$page = new TemplateLayout($this->renderAs, $this->app);
|
$page = new TemplateLayout($this->renderAs, $this->app);
|
||||||
|
|
||||||
|
if(is_array($additionalParams)) {
|
||||||
|
foreach ($additionalParams as $key => $value) {
|
||||||
|
$page->assign($key, $value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Add custom headers
|
// Add custom headers
|
||||||
$headers = '';
|
$headers = '';
|
||||||
foreach(OC_Util::$headers as $header) {
|
foreach(OC_Util::$headers as $header) {
|
||||||
|
@ -226,7 +232,7 @@ class OC_Template extends \OC\Template\Base {
|
||||||
$page->assign('headers', $headers);
|
$page->assign('headers', $headers);
|
||||||
|
|
||||||
$page->assign('content', $data);
|
$page->assign('content', $data);
|
||||||
return $page->fetchPage();
|
return $page->fetchPage($additionalParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $data;
|
return $data;
|
||||||
|
|
|
@ -154,7 +154,7 @@ class TemplateResponse extends Response {
|
||||||
$template->assign($key, $value);
|
$template->assign($key, $value);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $template->fetchPage();
|
return $template->fetchPage($this->params);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue