mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-04 18:34:27 +02:00
remove $global_assign property from Smarty and $global_assign-handling
from the constructor. the only visible change is, that $SCRIPT_NAME is not available in the tempates anymore. $smarty.server.SCRIPT_NAME has to be used from now.
This commit is contained in:
2
NEWS
2
NEWS
@@ -1,3 +1,5 @@
|
||||
- remove {$SCRIPT_NAME}. use {$smarty.server.SCRIPT_NAME} instead (messju)
|
||||
- remove $global_assign. assign global variables explicitly instead (messju)
|
||||
- remove warning in debug_print_var on php-resources (messju)
|
||||
- move function.assign.php to compiler.assign.php (messju)
|
||||
- add property $tpl_error_reporting (messju)
|
||||
|
@@ -339,16 +339,6 @@ class Smarty
|
||||
*/
|
||||
var $cache_handler_func = null;
|
||||
|
||||
/**
|
||||
* These are the variables from the globals array that are
|
||||
* assigned to all templates automatically. This isn't really
|
||||
* necessary any more, you can use the $smarty var to access them
|
||||
* directly.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
var $global_assign = array('HTTP_SERVER_VARS' => array('SCRIPT_NAME'));
|
||||
|
||||
/**
|
||||
* This indicates which filters are automatically loaded into Smarty.
|
||||
*
|
||||
@@ -590,32 +580,11 @@ class Smarty
|
||||
/**#@-*/
|
||||
/**
|
||||
* The class constructor.
|
||||
*
|
||||
* @uses $global_assign uses {@link assign()} to assign each corresponding
|
||||
* value from $GLOBALS to the template vars
|
||||
*/
|
||||
function Smarty()
|
||||
{
|
||||
foreach ($this->global_assign as $key => $var_name) {
|
||||
if (is_array($var_name)) {
|
||||
foreach ($var_name as $var) {
|
||||
if (isset($GLOBALS[$key][$var])) {
|
||||
$this->assign($var, $GLOBALS[$key][$var]);
|
||||
} else {
|
||||
$this->assign($var, null);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (isset($GLOBALS[$var_name])) {
|
||||
$this->assign($var_name, $GLOBALS[$var_name]);
|
||||
} else {
|
||||
$this->assign($var_name, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* assigns values to template variables
|
||||
*
|
||||
|
Reference in New Issue
Block a user