RE: [SMARTY-DEV] Re: Using complex variables in {foreach from="$var.element"} etc.

From: Date: Sun, 01 Aug 2004 21:06:57 +0000
Subject: RE: [SMARTY-DEV] Re: Using complex variables in {foreach from="$var.element"} etc.
References: 1  Groups: php.smarty.dev 
Request: Send a blank email to php-smarty-dev+get-2514@lists.php.net to get a copy of this message
As a rule of thumb, you should always omit quotes when referencing variables if possible (but remember: the "item" attribute of the {foreach} tag doesn't reference a variable but specifies a name that is used inside the loop). It's just like in PHP where you don't write foo("$bar"); either. At least I hope so ;) David > -----Original Message----- > From: Dmitry Koteroff [mailto:delete@koteroff.ru] > Sent: Sunday, August 01, 2004 9:59 PM > To: smarty-dev@lists.php.net > Subject: [SMARTY-DEV] Re: Using complex variables in {foreach > from="$var.element"} etc. > > DK> {foreach from="$array.elements"}...{/foreach} > Oh, my bad: {foreach from=$array.elements} (without quotes) > works. Hmm, very interesting. > > -- > Best regards, > Dmitry Koteroff. > > -- > Smarty Development Mailing List (http://smarty.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.smarty.dev (#2514) next »