mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-05 19:04:27 +02:00
- bugfix template inheritance fail when using custom resource after patch of 8.3.2014 (Issue 187)
This commit is contained in:
@@ -1,4 +1,7 @@
|
|||||||
===== trunk =====
|
===== trunk =====
|
||||||
|
06.04.2014
|
||||||
|
- bugfix template inheritance fail when using custom resource after patch of 8.3.2014 (Issue 187)
|
||||||
|
|
||||||
05.04.2014
|
05.04.2014
|
||||||
- bugfix default date format leads to extra spaces when displaying dates with single digit days (Issue 182)
|
- bugfix default date format leads to extra spaces when displaying dates with single digit days (Issue 182)
|
||||||
|
|
||||||
|
@@ -84,7 +84,7 @@ class Smarty_Internal_Compile_Block extends Smarty_Internal_CompileBase
|
|||||||
$this->template->block_data[$_name]['source'] = '';
|
$this->template->block_data[$_name]['source'] = '';
|
||||||
// build {block} for child block
|
// build {block} for child block
|
||||||
self::$block_data[$_name]['source'] =
|
self::$block_data[$_name]['source'] =
|
||||||
"{$compiler->smarty->left_delimiter}private_child_block name={$_attr['name']} file='{$compiler->template->source->filepath}'" .
|
"{$compiler->smarty->left_delimiter}private_child_block name={$_attr['name']} file='{$compiler->template->source->filepath}' type='{$compiler->template->source->type}' resource='{$compiler->template->template_resource}'" .
|
||||||
" uid='{$compiler->template->source->uid}' line={$compiler->lex->line}";
|
" uid='{$compiler->template->source->uid}' line={$compiler->lex->line}";
|
||||||
if ($_attr['nocache']) {
|
if ($_attr['nocache']) {
|
||||||
self::$block_data[$_name]['source'] .= ' nocache';
|
self::$block_data[$_name]['source'] .= ' nocache';
|
||||||
@@ -361,7 +361,7 @@ class Smarty_Internal_Compile_Private_Child_Block extends Smarty_Internal_Compil
|
|||||||
* @var array
|
* @var array
|
||||||
* @see Smarty_Internal_CompileBase
|
* @see Smarty_Internal_CompileBase
|
||||||
*/
|
*/
|
||||||
public $required_attributes = array('name', 'file', 'uid', 'line');
|
public $required_attributes = array('name', 'file', 'uid', 'line', 'type', 'resource');
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -377,7 +377,11 @@ class Smarty_Internal_Compile_Private_Child_Block extends Smarty_Internal_Compil
|
|||||||
$_attr = $this->getAttributes($compiler, $args);
|
$_attr = $this->getAttributes($compiler, $args);
|
||||||
|
|
||||||
// update template with original template resource of {block}
|
// update template with original template resource of {block}
|
||||||
$compiler->template->template_resource = realpath(trim($_attr['file'], "'"));
|
if (trim($_attr['type'], "'") == 'file') {
|
||||||
|
$compiler->template->template_resource = realpath(trim($_attr['file'], "'"));
|
||||||
|
} else {
|
||||||
|
$compiler->template->template_resource = trim($_attr['resource'], "'");
|
||||||
|
}
|
||||||
// source object
|
// source object
|
||||||
unset ($compiler->template->source);
|
unset ($compiler->template->source);
|
||||||
$exists = $compiler->template->source->exists;
|
$exists = $compiler->template->source->exists;
|
||||||
|
Reference in New Issue
Block a user