Hi!
Yesterday I started working on a calendar based on PHP/MySQL. I thought it would be a great idea to start using templates, so I played around a little with the FastTemplate class until I got the idea of how it worked.
On the main page I want a table generated with 5-6 rows (depending how many days it's in the months). And then the days generated in an own TD (with max 7 TDs in a row). You all know how a calendar works =)
I have 3 files main,tr and td.
Snippet from main:
<table border=1>
{TR}
</table>
Whole tr:
<tr>
{ROWS}
</tr>
Whole td
<td width=71 height=100 border=1>
{TD_CONTENT}
</td>
With these files I thought I could generate a table like a calendar with 2 for-loops. One inside the other, the first one parses trough the main file and replaces a {TR} with the tr file then the next loops starts and replaces {ROWS} with the right number of TDs and {TD_CONTENT} is assigned a value depending on what day it loops trough, and finishes when the right number of days have been drawn.
It doesn’t work very well, it seems like FastTemplate doesn’t replace anything until the print function, so every {ROWS} is replaced every loop so instead of max 7 TDs I get like 7-30 depending what row.
Is there any setting or function to make it work the way I want it? The code it’s all messed up now from testing different things, but I can rewrite the original code if it’s needed.
Thanks!