- fixed access of special smarty variables from included template

This commit is contained in:
Uwe.Tews
2009-04-23 13:32:45 +00:00
parent d991f96423
commit 1ee0747801
4 changed files with 5 additions and 1 deletions

View File

@@ -1,3 +1,6 @@
04/23/2009
- fixed access of special smarty variables from included template
04/22/2009
- unified template stream syntax with standard Smarty resource syntax $smarty->display('mystream:mytemplate')

View File

@@ -56,6 +56,7 @@ class Smarty_Internal_Compile_Foreach extends Smarty_Internal_CompileBase {
$output .= " \$_smarty_tpl->tpl_vars['smarty']->value['foreach'][$name]['total'] = \$_smarty_tpl->tpl_vars[$item]->total;\n";
$output .= " \$_smarty_tpl->tpl_vars['smarty']->value['foreach'][$name]['iteration']=0;\n";
$output .= " \$_smarty_tpl->tpl_vars['smarty']->value['foreach'][$name]['index']=-1;\n";
$output .= " \$_smarty_tpl->tpl_vars['smarty']->scope = 0;\n";
}
$output .= "if (count(\$_from) > 0){\n";
$output .= " foreach (\$_from as \$_smarty_tpl->tpl_vars[$item]->key => \$_smarty_tpl->tpl_vars[$item]->value){\n";

View File

@@ -34,6 +34,7 @@ class Smarty_Internal_Compile_Section extends Smarty_Internal_CompileBase {
$section_name = $_attr['name'];
$output .= "unset(\$_smarty_tpl->tpl_vars['smarty']->value['section'][$section_name]);\n";
$output .= "\$_smarty_tpl->tpl_vars['smarty']->scope = 0;\n";
$section_props = "\$_smarty_tpl->tpl_vars['smarty']->value['section'][$section_name]";
foreach ($_attr as $attr_name => $attr_value) {

View File

@@ -90,7 +90,6 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase {
$this->security = $this->smarty->security;
$this->cache_resource_class = 'Smarty_Internal_CacheResource_' . ucfirst($this->caching_type);
$this->parent = $_parent;
$this->tpl_vars['smarty'] = new Smarty_Variable;
// Template resource
$this->template_resource = $template_resource;
// parse resource name