Re: [SMARTY] [Template - announce] Templeet 0.9.2 available
| From: | Fabien Penso | Date: | Thu, 07 Nov 2002 14:43:47 +0000 |
| Subject: | Re: [SMARTY] [Template - announce] Templeet 0.9.2 available | ||
| References: | 1 2 3 4 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-6356@lists.php.net to get a copy of this message | ||
Mike a écrit :
> Fabien Penso wrote:
>> Maybe I am wrong then and should have posted that on comp.test ...
> I think you'll find a lot of people interested. But posting to the
> Smarty mailing list, it would be nice if you could highlight the main
> differences between the two solutions...
It's true, all my fault and I apologize. Let me write some lines about
it (please forgive me for my English :).
As far as I've seen Smarty, it allows you to export the HTML (template)
outside of your PHP, but you still have to write your own PHP code. Also
it adds an overhead as you have to, first write the php, then the
template which has a very special syntax (but this is a matter of taste
I guess). Templeet allows you to not have to write your own PHP, the
command are as short as possible, and having them into your template
with your HTML isn't a problem. Also even Templeet is made in PHP, it
could have been done in anything else (someone made a Python interpreter
for fun). That means the template syntax won't change, even if you
choose another interpreter (for any reason, up to you).
Let's say I want to do the following, take a RDF file, parse it, and
print it in a way I like. So I'll write the PHP code (or download a
function/class from the net), use Smarty to set up variables and things,
and have a template to print it.
In Templeet you would have your template, let's say index.en.tmpl for
index.html (the main English page) and add something like :
~rdf('http://slashdot.org/slashdot.rdf',0,10,
'LF','<div
class="div">','LL','</div>',
'LM','<a
href="~rdf_fld('link')">~rdf_fld('title')</a><br/>')
which would print you the from 0, the 10 next matches from the Slashdot
RDF file, something like :
<div class="div">
<a href=""></a><br/>
...
</div>
LF stands for Line First, LL Last Line, LM Line Match. You might test it
if you've installed the 0.9.2 version of Templeet.
I know the Templeet syntax for the template seems pretty strange at
first, but it gets really powerfull while you use it. I have made a
complete Gallery system which you can see at
http://perso.linuxfr.org/penso/index.php?/gallery/
with Templeet, the
template source is :
http://perso.linuxfr.org/penso/template/gallery.tmpl
--
Fabien Penso <penso@linuxfr.org> | LinuxFr a toujours besoin de :
http://perso.LinuxFr.org/penso/ | http://linuxFr.org/dons/
A PHP Template Engine ? Take the best ! http://templeet.org/