Re: Base-Templates Dir Feature Added to Smarty1.4.0

From: Date: Thu, 10 May 2001 14:29:55 +0000
Subject: Re: Base-Templates Dir Feature Added to Smarty1.4.0
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-740@lists.php.net to get a copy of this message
OIC, you're using 1.3.2, right? But we're talking about 1.4.0: 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, $this->undefined); } } } else { if (isset($GLOBALS[$var_name])) { $this->assign($var_name, $GLOBALS[$var_name]); } else { $this->assign($var_name, $this->undefined); } } } } I sent this patch to this list about two weeks ago. At 16:18 10.5. 2001, Jim Harlindong wrote the following: -------------------------------------------------------------- > function Smarty() > { > foreach ($this->global_assign as $var_name) { > if(isset($GLOBALS[$var_name])) { > $this->assign($var_name, $GLOBALS[$var_name]); > } > } > } > >In this case $varname will contain the *value* of the array element. So >if the element is >Global_assign[] = 'abc'; >Global_assign['two'] = array('def', 'jkl'); > >Now, $var_name in the foreach loop will have the *value* of the element >which in this case are >'abc', array('def', 'jkl') > >How does the array('def', 'jkl') gets to be a non array variable >accessed through $def and $jkl instead of $two.def and $two.jkl in >Smarty? > >Thanks for your help > >> -----Original Message----- >> From: Andrei Zmievski [mailto:andrei@ispi.net] >> Sent: Friday, 11 May 2001 12:05 AM >> To: Jim Harlindong >> Cc: smarty@lists.ispi.net >> Subject: [smarty] Re: Base-Templates Dir Feature Added to Smarty1.4.0 >> >> >> On Fri, 11 May 2001, Jim Harlindong wrote: >> > Why are these two methods of variables (one is straight >> vars the other >> > is associative array or array) accessed the same way in smarty? Can >> > someone explain to me? >> >> 'HTTP_SERVER_VARS' => 'SCRIPT_NAME' simply indicates where >> Smarty should assign $SCRIPT_NAME variable from. In this case >> it is assigned from the $HTTP_SERVER_VARS array. It's still >> just a simple variable. >> >> -Andrei >> >> "Tomorrow the sun will rise. And who knows what the tide will bring?" >> - Tom Hanks, in "Cast Away" >> >> --- >> You are currently subscribed to smarty as: >> jimmy@harlindong.com To unsubscribe send a blank email to >> $subst('Email.Unsub') >> Visit Smarty's homepage at >> http://www.phpinsider.com/php/code/Smarty/ >> >> > > > >--- >You are currently subscribed to smarty as: cynic@mail.cz >To unsubscribe send a blank email to $subst('Email.Unsub') >Visit Smarty's homepage at >http://www.phpinsider.com/php/code/Smarty/ ------end of quote------ cynic@mail.cz ------------- And the eyes of them both were opened and they saw that their files were world readable and writable, so they chmoded 600 their files. - Book of Installation chapt 3 sec 7

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