Re: Re: template engine choices (was Re: [PHP] template engine...why???)
| From: | Ryan A | Date: | Thu, 01 May 2003 11:43:35 +0000 |
| Subject: | Re: Re: template engine choices (was Re: [PHP] template engine...why???) | ||
| References: | 1 2 3 4 5 6 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-145929@lists.php.net to get a copy of this message | ||
Hi Rush,
Thank you for taking the time to reply to me.
Right now my "templating" is really really basic...I just have the header
and footer HTML (no php) as an include at the top and bottom of my site so I
dont think I really need a "templating system".Coming from JAVA servlets I
LOVE the way you can include stuff like this, its saves me hours.
PHP rocks and I dont think I will ever leave it.
But in the next few weeks I may be working on a big project and I think I
might be needing a templating system to work with, I know you are connected
with TT (as a developer or owner I dont know), I have visited your site and
found little details...
I was originally thinking of going with SMARTY as that seems to be the
popular choice for some time for people I know...
Since you are connected with TT I think you will know the insides of a
templating system better than the average PHP person (although there are
some wizards on everything PHP on the php general list)
a few questions if you dont mind:
(most important) Is TT free like SMARTY? :-)
Learning curve?
can you give me a few features that TT has that SMARTY fails at?
Any suggestions advise also welcome.
Cheers,
-Ryan
----- Original Message -----
From: "rush" <pipa@rush.avalon.hr>
To: <php-general@lists.php.net>
Sent: Thursday, May 01, 2003 11:55 AM
Subject: [PHP] Re: template engine choices (was Re: [PHP] template
engine...why???)
> "Seairth Jacobs" <seairth@seairth.com> wrote in message
> news:20030501040636.73655.qmail@pb1.pair.com...
> > If you want to go even more "abstract", you could attempt to separate
> *all*
> > presentation elements into templates and template snippets, likely using
> > some form of str_replace() to build the final presentation. In it's
> simpler
> > incarnation, the formatting of the data itself (e.g. showing thousands
> > separator in a number or not) will still be embedded in the code. More
> > complex versions may allow additional control over the formatting from
> > within the templating system itself. Whichever way you go, this
approach
> > adds more flexibility at the cost of complexity. In a sense, generating
> XML
> > and running it through XSLT would be an example of this flexibility. As
> > Rasmus points out, once you get to this level, you have practically
> > re-created PHP (ever notice just how complex XSLT can get?).
>
> TemplateTamer is closest to this approach, since your program basically
> have to prepare data tree that contains the data, and then engine
assembles
> html page from templates. The important differences from xml+xslt are:
>
> 1) you prepare a data tree as php array, not a dom tree
> 2) you do not have to write xslt or anything similar, since TT generates
> necessary PHP code to handle this part of functionality. (this is also in
my
> opinion biggest weaknes of xml+xslt: need to hack xslt, which contain both
> design and code)
> 3) There are much less "initialization" code you have to write like load
> this load that, call transform .. , allmost all of that is handled by TT
> 4) transformations done by TT engine are simpler than chores sablotron
needs
> to endure.
>
>
> > So, which way should you go? It depends on all sorts of factors:
> >
> > * Your comfort level with each style of templating.
> > * What your application may require:
> > * who will be editing the presentation portions
> > * how complex the presentations will be
> > * whether processing times will be significantly affected
> > * etc.
> > * etc.
> >
> > So... if include()s work for your needs, go with it! If you later on
> have
> > a need for a different approach, go with it! As we have seen from this
> > thread, there is no one right answer...
>
> Yup I agree with that.
>
> rush
> --
> http://www.templatetamer.com/
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>