Re: [SMARTY] loops and if statements
| From: | Monte Ohrt | Date: | Mon, 31 Mar 2003 18:07:16 +0000 |
| Subject: | Re: [SMARTY] loops and if statements | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-9015@lists.php.net to get a copy of this message | ||
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>