Pass template parameters to parent template

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl 2018-01-25 19:14:27 +01:00 committed by Roeland Jago Douma
parent d0a6368a8b
commit 0655df09d6
No known key found for this signature in database
GPG Key ID: F941078878347C0C
2 changed files with 8 additions and 2 deletions

View File

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

View File

@ -154,7 +154,7 @@ class TemplateResponse extends Response {
$template->assign($key, $value); $template->assign($key, $value);
} }
return $template->fetchPage(); return $template->fetchPage($this->params);
} }
} }