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

Loops
Hi all,

I don't know why I have so much trouble with Smarty and arrays...  Let's
assume I have the following data structure:

$EVENTS = array('event1' => array('dow' => "Saturday",
'month' => "March",
'day' => "13",
'year' => "2004",
'time' => "6:00 PM",
'title' => "St. Patrick's
Day Supper",
'location' => "Fellowship
Hall",
),
'event2' => array('dow' => "Saturday",
'month' => "March",
'day' => "27",
'year' => "2004",
'time' => "7:30 PM",
'title' => "Michael Nix
Concert",
'location' => "Sanctuary",
),
);

How would I loop through all of the events in my template?

I tried this:

// Loop through each event
{section name=i loop=$Events}
// Loop through the values for each event
{section name=j loop=$Events[i]}
{$Events[i][j].title}<br>
{/section}

Which didn't work.  Tips?  Suggestions?  As always, thanks in advance!

-Erich-

Report this thread to moderator Post Follow-up to this message
Old Post
Erich Beyrent
03-19-04 06:29 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 10:43 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.