[prev in list] [next in list] [prev in thread] [next in thread] 

List:       smarty-dev
Subject:    RE: [SMARTY-DEV] Re: Using complex variables in {foreach from="$var.element"} etc.
From:       David_Zülke <dz () bitxtender ! net>
Date:       2004-08-01 21:06:57
Message-ID: 200408012107.i71L7V3l029815 () mailer ! progressive-comp ! com
[Download RAW message or body]

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
> 

-- 
Smarty Development Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic