- fixed bug of {nocache} tag in included templates

This commit is contained in:
Uwe.Tews
2009-05-08 11:34:21 +00:00
parent ff4619801a
commit 0a64988240
3 changed files with 20 additions and 6 deletions

View File

@@ -1,3 +1,6 @@
05/08/2009
- fixed bug of {nocache} tag in included templates
05/06/2009 05/06/2009
- allow that plugins_dir folder names can end without directory separator - allow that plugins_dir folder names can end without directory separator

View File

@@ -45,7 +45,11 @@ class Smarty_Internal_Compile_Include extends Smarty_Internal_CompileBase {
} }
} }
// default for included templates // default for included templates
if ($compiler->template->caching) {
$_caching = SMARTY_CACHING_LIFETIME_CURRENT;
} else {
$_caching = SMARTY_CACHING_OFF; $_caching = SMARTY_CACHING_OFF;
}
/* /*
* if the {include} tag provides individual parameter for caching * if the {include} tag provides individual parameter for caching
* it will not be included into the common cache file and treated like * it will not be included into the common cache file and treated like
@@ -89,7 +93,7 @@ class Smarty_Internal_Compile_Include extends Smarty_Internal_CompileBase {
if (isset($_assign)) { if (isset($_assign)) {
$_output .= "\$_smarty_tpl->assign($_assign,\$_smarty_tpl->smarty->fetch(\$_template)); ?>"; $_output .= "\$_smarty_tpl->assign($_assign,\$_smarty_tpl->smarty->fetch(\$_template)); ?>";
} else { } else {
$_output .= "echo \$_smarty_tpl->smarty->fetch(\$_template); ?>"; $_output .= "\$_template->processInclude(); ?>";
} }
if ($_parent_scope != SMARTY_LOCAL_SCOPE) { if ($_parent_scope != SMARTY_LOCAL_SCOPE) {
$_output .= "<?php \$_template->updateParentVariables($_parent_scope); ?>"; $_output .= "<?php \$_template->updateParentVariables($_parent_scope); ?>";

View File

@@ -472,6 +472,13 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase {
} }
} }
function processInclude()
{
$_smarty_tpl = $this;
$_start_time = $this->_get_time();
eval("?>" . $this->getCompiledTemplate());
$this->render_time += $this->_get_time() - $_start_time;
}
/** /**
* Returns the rendered HTML output * Returns the rendered HTML output
* *