I am in need of web template engine and I am considering two options. PHPSavant and Smarty.
I am using PHP ver. 5 and PostgreSQL database. PHPSavant supports PHP5 only in beta2 version, so I am affraid of some serious bugs, but at the other hand, as far as I know, Smarty do not support PHP5 at all.
I do not want templates, where HTML and PHP are mixed up together like this:
<ul>
<?php
foreach($list as $line) {
echo '<li>'.$line['text'].'</li>';
}
?>
</ul>
or even worse, when template engine defines its own language:
<ul>
{foreach from=$list item="line"}
<li>{$line.text|escape}</li>
{/foreach}
</ul>
What I want are clean templates in template files and universal code to process them in the other file, like this:
base template (mylist.tpl.php):
<ul>
{TPL:LINE}
</ul>
line template (mylist_line.tpl.php):
<li>
{VAL:TEXT}
</li>
code being executed (process_template.php):
<?php
// some PHP script (containing NO HTML tags), which is loading and processing template files, according to arguments supplied
...
?>
Do anybody know PHPSavant and Smarty better than me (had used them) and can tell me which of these two is capable to meet my needs, please?