Re: [SMARTY] Code Snippet was: [SMARTY] To who's right is right??
| From: | Gerard Samuel | Date: | Tue, 18 Jun 2002 18:20:24 +0000 |
| Subject: | Re: [SMARTY] Code Snippet was: [SMARTY] To who's right is right?? | ||
| References: | 1 2 3 4 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-4929@lists.php.net to get a copy of this message | ||
Well I didn't see any limitations on the naming of variables in the manual except 'name' which I didn't use.
I did it this way, in the example (and in my templates) for ease of tracking variables, since the format is new to me (and to others,
when they modify it).
If there is a reason not to do it this way, let me know, so I can change some stuff around.
Should I be looking at these as if they were a real php foreach() function??
Thanks
Bertrand DUNOGIER wrote:
GS> {* There is nothing like a simple foreach loop *}
GS> {foreach item=data from=$data}
GS> The user {$data.name} id is ==> {$data.id}<br>
GS> {/foreach}
Err, don't you think that using the same variable for the value and
the source array is good ? It's not a relevant sample in my opinion :)
Bertrand
--
Gerard Samuel
http://www.trini0.org:81/
http://dev.trini0.org:81/