Forum Moderators: coopster
I have an html file that is something like this.
<html>
<body>
<table>
<!-- BEGIN spot1 -->
<tr><td>{someStuff}</td></tr>
<!-- END spot1 -->
<!-- BEGIN spot2 -->
<tr><td>{someOtherStuff}</td></tr>
<!-- END spot2 -->
</table>
</body>
</html>
The problem I have is when I set the templates they go where they are positioned in the HTML (obviously) but I want them to output in the order they are in PHP. What I mean is something like this
<?php
require_once("IT.php");
//load my template
$template = new HTML_Template_IT("./");
//load my html
$template->loadTemplatefile("my.tpl");
$template->setCurrentBlock("spot1");
$template->setVariable("someStuff", "this should be the first html");
$template->parseCurrentBlock();
$template->setCurrentBlock("spot2");
$template->setVariable("someOtherStuff", "this should be the second html");
$template->parseCurrentBlock();
$template->setCurrentBlock("spot1");
$template->setVariable("someStuff", "this should be the thrid html");
$template->parseCurrentBlock();
$template->show();
?>
Now my html would look something like this
this should be the first html
this should be the third html
this should be the secon html
It is like that because the way they are lined up in the template file.
Is there anyway to make them go one after the other in the order I want? Thanks,