You may want to take a look at Dreamtime's template engine.  I've had pretty
good feedback on it so far.

The template language supports things like loops, if-then, pre-compiling
templates, etc., which makes assembling complex pages pretty easy.  We
replaced a whole heap of Cold Fusion code with a few Dreamtime templates and
a little PHP code during a big conversion job (CF -> PHP) late last year.

For example, if you've got a few arrays of values and want to output an HTML
table, your PHP code looks like:

$names = array("Tim", "Alice", "Dilbert");
$ages = array(34, 36, 37);
$t = new DTTemplate("table.html");
$t->set("names", $names);
$t->set("ages", $ages);
$t->send();

and your template (table.html) could look like:

<table>
{:each:names}
  <tr><td>{names}</td><td>{ages+}</td>
  </tr>
{:end}
</table>

The layer above this, the Page Manager, supports the lists of variable
hashes you talked about, so that you can give it a big associative array
instead of doing a series of set() calls for each variable.

- Tim
  http://www.phptemplates.org

----- Original Message -----
From: "scott [gts]" <[EMAIL PROTECTED]>
To: "php" <[EMAIL PROTECTED]>
Sent: Wednesday, June 20, 2001 5:29 PM
Subject: [PHP] Another Template Engine (code)


> i wrote a simple classified and hash-enabled template engine
> as a sort-of proof of concept....


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to