Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Re: [SMARTY] using index_prev with foreach
Hi,

At this stage foreach loops do not set index_prev as section does.
Only iteration/first/last/total/show as per the foreach docs.

-bok

On 04 Aug 2004 10:43:01 +0200, Hiro Protagonist <hiro-@gmx.de> wrote:
> Hi,
>
> I have an array, with e.g. this keys: unit, name, phone.
> I would like to loop through the array with foreach (works fine) and
> would like to put out a extra <tr>, if the unit changes. So the output
> will be grouped by unit.
>
> I tried this:
>
> {foreach name=members from=$arrayMembers item=mem}
> {if $smarty.foreach.members.first or
> $smarty.foreach.members.index_prev.unit ne $smarty.foreach.members.unit}
> Special unit-Row
> {/if}
> Normal-Row
> {/foreach}
>
> Doesn't work.
>
> It works with sections, but i thought, doing it with foreach would make
> the code simpler. Any ideas?
>
> thx
>
> Hiro
>
> --
> Hi! I'm a .sig virus! Copy me to your .sig!
>
> --
> Smarty General Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

Report this thread to moderator Post Follow-up to this message
Old Post
Robert Amos
08-04-04 02:06 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PHP Smarty Templates archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 04:33 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.