mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-09 12:54:26 +02:00
- fixed access of special smarty variables from included template
This commit is contained in:
@@ -1,3 +1,6 @@
|
|||||||
|
04/23/2009
|
||||||
|
- fixed access of special smarty variables from included template
|
||||||
|
|
||||||
04/22/2009
|
04/22/2009
|
||||||
- unified template stream syntax with standard Smarty resource syntax $smarty->display('mystream:mytemplate')
|
- unified template stream syntax with standard Smarty resource syntax $smarty->display('mystream:mytemplate')
|
||||||
|
|
||||||
|
@@ -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]['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]['iteration']=0;\n";
|
||||||
$output .= " \$_smarty_tpl->tpl_vars['smarty']->value['foreach'][$name]['index']=-1;\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 .= "if (count(\$_from) > 0){\n";
|
||||||
$output .= " foreach (\$_from as \$_smarty_tpl->tpl_vars[$item]->key => \$_smarty_tpl->tpl_vars[$item]->value){\n";
|
$output .= " foreach (\$_from as \$_smarty_tpl->tpl_vars[$item]->key => \$_smarty_tpl->tpl_vars[$item]->value){\n";
|
||||||
|
@@ -34,6 +34,7 @@ class Smarty_Internal_Compile_Section extends Smarty_Internal_CompileBase {
|
|||||||
$section_name = $_attr['name'];
|
$section_name = $_attr['name'];
|
||||||
|
|
||||||
$output .= "unset(\$_smarty_tpl->tpl_vars['smarty']->value['section'][$section_name]);\n";
|
$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]";
|
$section_props = "\$_smarty_tpl->tpl_vars['smarty']->value['section'][$section_name]";
|
||||||
|
|
||||||
foreach ($_attr as $attr_name => $attr_value) {
|
foreach ($_attr as $attr_name => $attr_value) {
|
||||||
|
@@ -90,7 +90,6 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase {
|
|||||||
$this->security = $this->smarty->security;
|
$this->security = $this->smarty->security;
|
||||||
$this->cache_resource_class = 'Smarty_Internal_CacheResource_' . ucfirst($this->caching_type);
|
$this->cache_resource_class = 'Smarty_Internal_CacheResource_' . ucfirst($this->caching_type);
|
||||||
$this->parent = $_parent;
|
$this->parent = $_parent;
|
||||||
$this->tpl_vars['smarty'] = new Smarty_Variable;
|
|
||||||
// Template resource
|
// Template resource
|
||||||
$this->template_resource = $template_resource;
|
$this->template_resource = $template_resource;
|
||||||
// parse resource name
|
// parse resource name
|
||||||
|
Reference in New Issue
Block a user