Global assign
| From: | Bicou | Date: | Thu, 17 May 2001 16:32:18 +0000 |
| Subject: | Global assign | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-770@lists.php.net to get a copy of this message | ||
I've made a modification to the constructor in Smarty.class.php, line 171 :
The block :
$this->assign($var_name, $GLOBALS[$var_name]);
replaced with :
if (is_array($GLOBALS[$var_name])) {
$this->assign($GLOBALS[$var_name]);
} else {
$this->assign($var_name, $GLOBALS[$var_name]);
}
}
So I can write :
var $global_assign = array('HTTP_POST_VARS', 'HTTP_SERVER_VARS' => array( 'SCRIPT_NAME' ));
and all http_post_vars are assigned with key correspondance, instead of doing this by hand.