Re: Base-Templates Dir Feature Added to Smarty1.4.0
| From: | Jim Harlindong | Date: | Thu, 10 May 2001 14:18:08 +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-739@lists.php.net to get a copy of this message | ||
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/
>
>