Posted: Wed May 04, 2005 7:57 pm
I've already got the best if and if/else done, but thanks for the example. 
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
ditto, good luck with your project and let us know how it goesphice wrote:I typically create code that runs much faster in smaller amounts of lines than most conventional software packages.......
.........I believe it's faster for me to just create my own (and learn from it, too) than just hack away at someone else's work.
Are you sure its working right? Try this onephice wrote:This isn't for a designer, but a production-level, company-owned website. The reason I want an advanced templating system is that I would like to be able to run the whole website through an advanced templating system without having to make .php files left and right. This would allow my partner(s) to learn the language very quickly (no xml, php knowledge required) and not waste any time.
I've managed to make <if condition="--">---</if> and <if condition="--">---<else>---</if> work properly, and am working on <if condition="--">---<elseif condition="--">---<else>---</if>.
Code: Select all
// test.html
<table border="e;0"e; cellpadding="e;0"e; cellspacing="e;0"e; width="e;100%"e;>
<tr>
<th>MID</th>
<th> </th>
<th>Company</th>
<th> </th>
</tr>
<?
for ($t=0; $t<count($list); $t++) {
$merch=merchant_by_userid($listї$t]ї'id']);
?>
<tr>
<td><?=$merchї'MID']?></td>
<td> </td>
<td><?=$merchї'company']?></td>
<td> </td>
</tr>
<?
}
?>
</table>Code: Select all
// test.php
$main=new cTemplate("e;templates/test.html"e;);
$main->put("e;list"e;, $list);
$content=$main->parse();
$template=new cTemplate("e;templates/global.html"e;);
$template->put("e;title"e;, $title);
$template->put("e;keywords"e;, $keywords);
$template->put("e;content"e;, $content);
print $template->parse();