I would like to ask some help and ideas on how to implement a loop inside the template. I can do foearch below but how can i include it to the template and show it in the re
PHP itself is as good at templates as any other engine.
No need anything else
$pagetitle = "My Template Class";
foreach($results as $row) {
$row['date'] = date("m/d/y");
$data[] = $row;
}
$data = chunk_split($data,3);
Then in template
=$pagetitle?>
Hello =$name?>!
The time is: =$date?>
Embedded PHP works in the template
But embed PHP in the data is a VERY BAD IDEA
=$address?>
I made your example a bit more complicated yet closer to the real life.
It will print your table in the rows by 3 columns in each