Re: [SMARTY] loops and if statements
| From: | Daniel McCullough | Date: | Mon, 31 Mar 2003 18:09:15 +0000 |
| Subject: | Re: [SMARTY] loops and if statements | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-9016@lists.php.net to get a copy of this message | ||
Oh snap you can just say last.
From: Monte Ohrt <monte@ispi.net> To: Daniel McCullough <daniel_mccullough@hotmail.com> CC: Smarty General <smarty-general@lists.php.net> Subject: Re: [SMARTY] loops and if statements Date: 31 Mar 2003 12:07:16 -0600 MIME-Version: 1.0 Received: from pb1.pair.com ([216.92.131.4]) by mc3-f13.law16.hotmail.com with Microsoft SMTPSVC(5.0.2195.5600); Mon, 31 Mar 2003 10:07:56 -0800 Received: (qmail 53257 invoked by uid 1010); 31 Mar 2003 18:07:52 -0000 Received: (qmail 53242 invoked from network); 31 Mar 2003 18:07:52 -0000 X-Message-Info: JGTYoYF78jEHjJx36Oi8+Q1OJDRSDidP Mailing-List: contact smarty-general-help@lists.php.net; run by ezmlm Precedence: bulk list-help: <mailto:smarty-general-help@lists.php.net> list-unsubscribe: <mailto:smarty-general-unsubscribe@lists.php.net> list-post: <mailto:smarty-general@lists.php.net> Delivered-To: mailing list smarty-general@lists.php.net In-Reply-To: <BAY1-F18tOlxlMWvawj000590ac@hotmail.com> References: <BAY1-F18tOlxlMWvawj000590ac@hotmail.com> Organization: Message-Id: <1049134036.18551.35.camel@lena.ispi.prv> X-Mailer: Ximian Evolution 1.2.0 Return-Path: smarty-general-return-9015-daniel_mccullough=hotmail.com@lists.php.net X-OriginalArrivalTime: 31 Mar 2003 18:07:57.0145 (UTC) FILETIME=[7524DC90:01C2F7B0] For the first one: {section name=foo loop=$bar} {$bar[foo]}{if $smarty.section.foo.last}<br />{else}|{/if} {/section} The second one, you can probably use the {html_table} function, new to 2.5.0. Or, do that by manually if all you want is a break after line 5: {section name=foo loop=$bar} {$bar[foo]}{if $smarty.section.foo.iteration eq 5}<br />{/if} {/section} On Mon, 2003-03-31 at 11:48, Daniel McCullough wrote: I'm very new to Smarty, but I started with a project/exercise that will do something to get me more familiar with Smarty. I wanted to ask what is the best way to split loops/divide loops. Like lets say I have a list of 6 items and I want after each item but the last to have a |, but after the last item just a < br >. Second example is I have a list of 10 things, I want the first five on the first line and the second five on the second line how would I do that. thanks, _________________________________________________________________ Add photos to your messages with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail -- Monte Ohrt <monte@ispi.net> -- Smarty General Mailing List (http://smarty.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php_________________________________________________________________ The new MSN 8: smart spam protection and 2 months FREE* http://join.msn.com/?page=features/junkmail