RE: Re: Using complex variables in {foreach from="$var.element"} etc.

David Zülke <[email protected]>
Newsgroups gmane.comp.php.smarty.devel
Message-ID <[email protected]>
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:[email protected]]
> Sent: Sunday, August 01, 2004 9:59 PM
> To: [email protected]
> 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
> 

-- 
Smarty Development Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.