?
=?ISO-8859-1?Q?Jan-Erik_Meyer-L=FCtgens?=
Try Cheetah: http://www.cheetahtemplate.org/Miika said:Hi all
I was in need for a simple template engine (like PEAR::IT.php) and didn't
find any suitable. Yes, there is many templating engines available but
most are far too complex or does implement some additional features in
their syntax.
<HTML>
<HEAD><TITLE>$title</TITLE></HEAD>
<BODY>
<TABLE>
#for $client in $clients
<TR>
<TD>$client.surname, $client.firstname</TD>
<TD><A HREF="mailto:$client.email">$client.email</A></TD>
</TR>
#end for
</TABLE>
</BODY>
</HTML>
------------------------------------------------------
from Cheetah.Template import Template
class Client:
def __init__(self, surname, firstname, email)
self.surname = surname
self.firstname = firstname
self.email = email
clients = [
Client('Meyer-Lütgens', 'Jan-Erik', '(e-mail address removed)'),
Client('Keskinen', 'Miika', '(e-mail address removed)'),
]
tpl = Template(file='path_to_tpl_file')
tpl.title = 'The Title'
tpl.clients = clients
print tpl