fixed problem with vars as attributes in {include_php}

This commit is contained in:
messju
2003-08-13 16:37:12 +00:00
parent 4b034eaa81
commit 2319787c5f
2 changed files with 12 additions and 8 deletions
+4 -6
View File
@@ -26,22 +26,20 @@ function smarty_core_smarty_include_php($params, &$smarty)
$_smarty_resource_type = $_params['resource_type'];
$_smarty_php_resource = $_params['php_resource'];
extract($params['smarty_include_vars'], EXTR_PREFIX_SAME, 'include_php_');
if (!empty($params['smarty_assign'])) {
ob_start();
if ($_smarty_resource_type == 'file') {
$smarty->_include($_smarty_php_resource, $params['smarty_once']);
$smarty->_include($_smarty_php_resource, $params['smarty_once'], $params['smarty_include_vars']);
} else {
$smarty->_eval($_smarty_php_resource);
$smarty->_eval($_smarty_php_resource, $params['smarty_include_vars']);
}
$smarty->assign($params['smarty_assign'], ob_get_contents());
ob_end_clean();
} else {
if ($_smarty_resource_type == 'file') {
$smarty->_include($_smarty_php_resource, $params['smarty_once']);
$smarty->_include($_smarty_php_resource, $params['smarty_once'], $params['smarty_include_vars']);
} else {
$smarty->_eval($_smarty_php_resource);
$smarty->_eval($_smarty_php_resource, $params['smarty_include_vars']);
}
}
}