mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-07 11:54:26 +02:00
- allow {function} tags within {block} tags
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
11/30/2009
|
11/30/2009
|
||||||
- map 'true' to SMARTY_CACHING_LIFETIME_CURRENT for the $smarty->caching parameter
|
- map 'true' to SMARTY_CACHING_LIFETIME_CURRENT for the $smarty->caching parameter
|
||||||
|
- allow {function} tags within {block} tags
|
||||||
|
|
||||||
11/28/2009
|
11/28/2009
|
||||||
- ignore compile_id at debug template
|
- ignore compile_id at debug template
|
||||||
|
@@ -72,6 +72,13 @@ class Smarty_Internal_Compile_Blockclose extends Smarty_Internal_CompileBase {
|
|||||||
} elseif (!empty($this->smarty->block_data[$_name])) {
|
} elseif (!empty($this->smarty->block_data[$_name])) {
|
||||||
$_output = $this->smarty->block_data[$_name]['compiled'];
|
$_output = $this->smarty->block_data[$_name]['compiled'];
|
||||||
}
|
}
|
||||||
|
if (isset($this->smarty->block_data[$_name]['function'])) {
|
||||||
|
if (isset($compiler->template->properties['function'])) {
|
||||||
|
$compiler->template->properties['function'] = array_merge ($compiler->template->properties['function'], $this->smarty->block_data[$_name]['function']);
|
||||||
|
} else {
|
||||||
|
$compiler->template->properties['function'] = $this->smarty->block_data[$_name]['function'];
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$_output = $compiler->template->extracted_compiled_code;
|
$_output = $compiler->template->extracted_compiled_code;
|
||||||
}
|
}
|
||||||
|
@@ -60,7 +60,6 @@ class Smarty_Internal_Compile_Extends extends Smarty_Internal_CompileBase {
|
|||||||
$_tpl->template_filepath = $this->compiler->template->getTemplateFilepath();
|
$_tpl->template_filepath = $this->compiler->template->getTemplateFilepath();
|
||||||
$_tpl->forceNocache = true;
|
$_tpl->forceNocache = true;
|
||||||
$_compiled_content = $_tpl->getCompiledTemplate();
|
$_compiled_content = $_tpl->getCompiledTemplate();
|
||||||
unset($_tpl);
|
|
||||||
$_name = trim($_match[3], "\"'}");
|
$_name = trim($_match[3], "\"'}");
|
||||||
|
|
||||||
if (isset($this->smarty->block_data[$_name])) {
|
if (isset($this->smarty->block_data[$_name])) {
|
||||||
@@ -82,6 +81,10 @@ class Smarty_Internal_Compile_Extends extends Smarty_Internal_CompileBase {
|
|||||||
} else {
|
} else {
|
||||||
$this->smarty->block_data[$_name]['mode'] = 'replace';
|
$this->smarty->block_data[$_name]['mode'] = 'replace';
|
||||||
}
|
}
|
||||||
|
if (isset($_tpl->properties['function'])) {
|
||||||
|
$this->smarty->block_data[$_name]['function'] = $_tpl->properties['function'];
|
||||||
|
}
|
||||||
|
unset($_tpl);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -113,7 +113,6 @@ class Smarty_Internal_Resource_Extends {
|
|||||||
$_tpl->template_filepath = $this->template->getTemplateFilepath();
|
$_tpl->template_filepath = $this->template->getTemplateFilepath();
|
||||||
$_tpl->forceNocache= true;
|
$_tpl->forceNocache= true;
|
||||||
$_compiled_content = $_tpl->getCompiledTemplate();
|
$_compiled_content = $_tpl->getCompiledTemplate();
|
||||||
unset($_tpl);
|
|
||||||
$_name = trim($_match[3], "\"'}");
|
$_name = trim($_match[3], "\"'}");
|
||||||
|
|
||||||
if (isset($this->smarty->block_data[$_name])) {
|
if (isset($this->smarty->block_data[$_name])) {
|
||||||
@@ -135,6 +134,10 @@ class Smarty_Internal_Resource_Extends {
|
|||||||
} else {
|
} else {
|
||||||
$this->smarty->block_data[$_name]['mode'] = 'replace';
|
$this->smarty->block_data[$_name]['mode'] = 'replace';
|
||||||
}
|
}
|
||||||
|
if (isset($_tpl->properties['function'])) {
|
||||||
|
$this->smarty->block_data[$_name]['function'] = $_tpl->properties['function'];
|
||||||
|
}
|
||||||
|
unset($_tpl);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user