Re: Little tweak around GLOBAL variables

From: Date: Tue, 19 Mar 2002 14:47:31 +0000
Subject: Re: Little tweak around GLOBAL variables
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-3110@lists.php.net to get a copy of this message
Hi, Letting Smarty access all the global variables doesn't seem such a good idea, because its goal is not to function as a programming language. You can already access most of the variables via $smarty.(get,post,cookies,server,session,env,request) syntax. On Thu, 13 Mar 2008, Artem Orlov wrote: > Hello! > > I think this may be usefull, now we can use special variable $smarty to > access global variables. > Like this: > {$smarty.globals.global_var} > > *** Smarty_Compiler.class.php.orig Thu Feb 21 22:14:10 2002 > --- Smarty_Compiler.class.php Wed Mar 13 16:32:24 2002 > *************** > *** 1251,1256 **** > --- 1251,1262 ---- > $compiled_ref = > "\$GLOBALS['HTTP_SESSION_VARS']['$name']"; > break; > > + case 'globals': > + array_shift($indexes); > + $name = substr($indexes[0], 1); > + $compiled_ref = "\$GLOBALS['$name']"; > + break; > + > /* > * These cases are handled either at run-time or elsewhere > in the > * compiler. > > > > ______________________________________________ > Artem Orlov http://design.ural.ru > > > --- > You are currently subscribed to smarty as: andrei@ispi.net > To unsubscribe send a blank email to $subst('Email.Unsub') > Visit Smarty's homepage at > http://www.phpinsider.com/php/code/Smarty/ -Andrei "The day Microsoft makes something that doesn't suck, is probably the day Microsoft starts making vacuum cleaners." - Ernst Jan Plugge

« previous php.smarty.general (#3110) next »