mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-04 18:34:27 +02:00
- improvement/bugfix when Smarty::fetch() is called on a template object the inheritance and tplFunctions property
should be copied to the called template object
This commit is contained in:
@@ -1,4 +1,8 @@
|
|||||||
===== 3.1.31-dev ===== (xx.xx.xx)
|
===== 3.1.31-dev ===== (xx.xx.xx)
|
||||||
|
23.10.2016
|
||||||
|
- improvement/bugfix when Smarty::fetch() is called on a template object the inheritance and tplFunctions property
|
||||||
|
should be copied to the called template object
|
||||||
|
|
||||||
21.10.2016
|
21.10.2016
|
||||||
- bugfix for compile locking touched timestamp of old compiled file was not restored on compilation error https://github.com/smarty-php/smarty/issues/308
|
- bugfix for compile locking touched timestamp of old compiled file was not restored on compilation error https://github.com/smarty-php/smarty/issues/308
|
||||||
|
|
||||||
|
@@ -114,7 +114,7 @@ class Smarty extends Smarty_Internal_TemplateBase
|
|||||||
/**
|
/**
|
||||||
* smarty version
|
* smarty version
|
||||||
*/
|
*/
|
||||||
const SMARTY_VERSION = '3.1.31-dev/38';
|
const SMARTY_VERSION = '3.1.31-dev/39';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* define variable scopes
|
* define variable scopes
|
||||||
|
@@ -14,7 +14,7 @@
|
|||||||
* @package Smarty
|
* @package Smarty
|
||||||
* @subpackage Template
|
* @subpackage Template
|
||||||
*
|
*
|
||||||
* @property int $_objType
|
* @property int $_objType
|
||||||
*
|
*
|
||||||
* The following methods will be dynamically loaded by the extension handler when they are called.
|
* The following methods will be dynamically loaded by the extension handler when they are called.
|
||||||
* They are located in a corresponding Smarty_Internal_Method_xxxx class
|
* They are located in a corresponding Smarty_Internal_Method_xxxx class
|
||||||
@@ -157,18 +157,26 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data
|
|||||||
$template = $this;
|
$template = $this;
|
||||||
}
|
}
|
||||||
} elseif (is_object($template)) {
|
} elseif (is_object($template)) {
|
||||||
|
/* @var Smarty_Internal_Template $template */
|
||||||
if (!isset($template->_objType) || !$template->_isTplObj()) {
|
if (!isset($template->_objType) || !$template->_isTplObj()) {
|
||||||
throw new SmartyException($function . '():Template object expected');
|
throw new SmartyException($function . '():Template object expected');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// get template object
|
// get template object
|
||||||
/* @var Smarty_Internal_Template $template */
|
|
||||||
$saveVars = false;
|
$saveVars = false;
|
||||||
|
|
||||||
$template = $smarty->createTemplate($template, $cache_id, $compile_id, $parent ? $parent : $this, false);
|
$template = $smarty->createTemplate($template, $cache_id, $compile_id, $parent ? $parent : $this, false);
|
||||||
if ($this->_objType == 1) {
|
if ($this->_objType == 1) {
|
||||||
// set caching in template object
|
// set caching in template object
|
||||||
$template->caching = $this->caching;
|
$template->caching = $this->caching;
|
||||||
|
} else {
|
||||||
|
/* @var Smarty_Internal_Template $this */
|
||||||
|
$template->tplFunctions = $this->tplFunctions;
|
||||||
|
$template->inheritance = $this->inheritance;
|
||||||
|
}
|
||||||
|
/* @var Smarty_Internal_Template $parent */
|
||||||
|
if (isset($parent->_objType) && ($parent->_objType == 2) && !empty($parent->tplFunctions)) {
|
||||||
|
$template->tplFunctions = array_merge($parent->tplFunctions, $template->tplFunctions);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// fetch template content
|
// fetch template content
|
||||||
|
Reference in New Issue
Block a user