4 * Smarty Method AssignGlobal
6 * Smarty::assignGlobal() method
9 * @subpackage PluginsInternal
12 class Smarty_Internal_Method_AssignGlobal
15 * Valid for all objects
22 * assigns a global Smarty variable
24 * @param \Smarty_Internal_Data|\Smarty_Internal_Template|\Smarty $data
25 * @param string $varName the global variable name
26 * @param mixed $value the value to assign
27 * @param boolean $nocache if true any output of this variable will be not cached
29 * @return \Smarty_Internal_Data|\Smarty_Internal_Template|\Smarty
31 public function assignGlobal(Smarty_Internal_Data $data, $varName, $value = null, $nocache = false)
34 Smarty::$global_tpl_vars[ $varName ] = new Smarty_Variable($value, $nocache);
36 while ($ptr->_isTplObj()) {
37 $ptr->tpl_vars[ $varName ] = clone Smarty::$global_tpl_vars[ $varName ];