mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-03 18:04:26 +02:00
Fix passing config vars to included files.
This commit is contained in:
@@ -698,9 +698,10 @@ class Smarty
|
|||||||
function _smarty_include($_smarty_include_tpl_file, $_smarty_include_vars,
|
function _smarty_include($_smarty_include_tpl_file, $_smarty_include_vars,
|
||||||
&$_smarty_config_parent)
|
&$_smarty_config_parent)
|
||||||
{
|
{
|
||||||
|
$_smarty_config = $_smarty_config_parent;
|
||||||
$this->_tpl_vars = array_merge($this->_tpl_vars, $_smarty_include_vars);
|
$this->_tpl_vars = array_merge($this->_tpl_vars, $_smarty_include_vars);
|
||||||
extract($this->_tpl_vars);
|
extract($this->_tpl_vars);
|
||||||
|
|
||||||
$this->_process_template($_smarty_include_tpl_file, $compile_path);
|
$this->_process_template($_smarty_include_tpl_file, $compile_path);
|
||||||
include($compile_path);
|
include($compile_path);
|
||||||
}
|
}
|
||||||
|
@@ -373,8 +373,6 @@ class Smarty_Compiler extends Smarty {
|
|||||||
|
|
||||||
return "<?php " .
|
return "<?php " .
|
||||||
"\$_smarty_tpl_vars = \$this->_tpl_vars;\n" .
|
"\$_smarty_tpl_vars = \$this->_tpl_vars;\n" .
|
||||||
"unset(\$_smarty_defined_vars['_smarty_include_tpl_file']);\n" .
|
|
||||||
"unset(\$_smarty_defined_vars['_smarty_include_vars']);\n" .
|
|
||||||
"\$this->_smarty_include(".$_smarty_include_tpl_file.", array(".implode(',', (array)$arg_list)."), \$_smarty_config);\n" .
|
"\$this->_smarty_include(".$_smarty_include_tpl_file.", array(".implode(',', (array)$arg_list)."), \$_smarty_config);\n" .
|
||||||
"\$this->_tpl_vars = \$_smarty_tpl_vars;\n" .
|
"\$this->_tpl_vars = \$_smarty_tpl_vars;\n" .
|
||||||
"unset(\$_smarty_tpl_vars); ?>";
|
"unset(\$_smarty_tpl_vars); ?>";
|
||||||
|
@@ -698,9 +698,10 @@ class Smarty
|
|||||||
function _smarty_include($_smarty_include_tpl_file, $_smarty_include_vars,
|
function _smarty_include($_smarty_include_tpl_file, $_smarty_include_vars,
|
||||||
&$_smarty_config_parent)
|
&$_smarty_config_parent)
|
||||||
{
|
{
|
||||||
|
$_smarty_config = $_smarty_config_parent;
|
||||||
$this->_tpl_vars = array_merge($this->_tpl_vars, $_smarty_include_vars);
|
$this->_tpl_vars = array_merge($this->_tpl_vars, $_smarty_include_vars);
|
||||||
extract($this->_tpl_vars);
|
extract($this->_tpl_vars);
|
||||||
|
|
||||||
$this->_process_template($_smarty_include_tpl_file, $compile_path);
|
$this->_process_template($_smarty_include_tpl_file, $compile_path);
|
||||||
include($compile_path);
|
include($compile_path);
|
||||||
}
|
}
|
||||||
|
@@ -373,8 +373,6 @@ class Smarty_Compiler extends Smarty {
|
|||||||
|
|
||||||
return "<?php " .
|
return "<?php " .
|
||||||
"\$_smarty_tpl_vars = \$this->_tpl_vars;\n" .
|
"\$_smarty_tpl_vars = \$this->_tpl_vars;\n" .
|
||||||
"unset(\$_smarty_defined_vars['_smarty_include_tpl_file']);\n" .
|
|
||||||
"unset(\$_smarty_defined_vars['_smarty_include_vars']);\n" .
|
|
||||||
"\$this->_smarty_include(".$_smarty_include_tpl_file.", array(".implode(',', (array)$arg_list)."), \$_smarty_config);\n" .
|
"\$this->_smarty_include(".$_smarty_include_tpl_file.", array(".implode(',', (array)$arg_list)."), \$_smarty_config);\n" .
|
||||||
"\$this->_tpl_vars = \$_smarty_tpl_vars;\n" .
|
"\$this->_tpl_vars = \$_smarty_tpl_vars;\n" .
|
||||||
"unset(\$_smarty_tpl_vars); ?>";
|
"unset(\$_smarty_tpl_vars); ?>";
|
||||||
|
Reference in New Issue
Block a user