Re: [SMARTY] Loops

From: Date: Mon, 15 Mar 2004 10:31:19 +0000
Subject: Re: [SMARTY] Loops
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-11123@lists.php.net to get a copy of this message
Erich Beyrent writes: > I see, he says. Is it more advantageous for me to simply change the data > structure to this [...] Each to his own; I don't think I ever use section, as I find having meaningful array keys useful, and even when they are simply numerical foreach copes just as well as section. Indeed, having used Smarty for some time I couldn;t tell you the syntax for section without looking it up. On the other hand, I suspect that section is more commonly used (from the comments and sample code I've seen). If you typically have meaningful array keys, use foreach. If you don't, use section. To me, {foreach from=$Events item=event} {$event.title} {/foreach} .. just "makes sense", even for numerical keys. -- Mark Rogers, More Solutions Ltd :: Tel: 0845 45 89 555

« previous php.smarty.general (#11123) next »