Hi all.
For a new web-application im trying to find out what the best templating system is to use.
The app follows the mvc pattern.
Right now i've looked at HTML::Template(::Expr), HTML::Template::Pro, ZM::Template and Petal.
I'm trying to find out what the pro's and cons are for these templating systems, and why i should prefer one over the other.
Any suggestions (and experience) with these?
thanks again
Update
Thanks for the reactions, for now i'm convinced to use Petal, i only don't know the memory usage of it yet...
* Internationalized (i18n)
* The template can be viewed in any browser / editor, the petal ta
+gs are embedded in the html-tags.
* Straight forward (small learning curve when used to HTML::Templa
+te)
* Petal provides a mini-language
* Petal is xml-based, which is fine if you have well-done XHTML.
* It's pretty mature and has an active community.
* Installable with apt-get install libpetal-perl
* The HTML beforehand is well formed, includes sample values for t
+he dynamic parts and all you have to do with Dream weaver is apply st
+yles to the sample data and all will be well. At template compile tim
+e, all the sample data is discarded and then at run time, the real da
+ta is inserted.
Cons
* The thing that takes the most getting used to is that it's a lit
+tle verbose. Unfortunately this is a necessary side effect of being t
+ruly compatible with XML/HTML.
"We all agree on the necessity of compromise. We just can't agree on when it's necessary to compromise." - Larry Wall.
Re: choosing the best templating system
by Fang (Pilgrim) on Jul 06, 2005 at 10:56 UTC
|
| [reply] |
Re: choosing the best templating system
by gellyfish (Monsignor) on Jul 06, 2005 at 11:00 UTC
|
| [reply] |
|
| [reply] |
Re: choosing the best templating system
by samtregar (Abbot) on Jul 06, 2005 at 14:54 UTC
|
I've done a fair amount of work with Petal recently on the MKDoc project. In general it's a pretty neat system, but it does suffer from some signficant drawbacks:
- Terrible error messages. If something goes wrong you're pretty much left on your own to figure out what it was.
- XML was never meant to be edited by hand, a fact that will become painfully obvious if you try to edit your templates in a normal text editor!
- It's quite slow. I've seen cases where relatively simple templates take several seconds to process for no obvious reason.
-sam
PS: Of course, no discusssion of templating would be complete without a pointer to the article on the subject, Choosing a Templating System by our own perrin! Ignore it at your own risk. | [reply] |
|
| [reply] |
|
On what machine were you running,
Fedora Core 3 running under VMWare on Windows XP SP2. The machine is an AthlonXP 2500 with 756MB of RAM.
how was the memory usage of the module?
It's hard to say. MKDoc is generally a memory-hungry system so it's not easy to say how much Petal contributes to that.
were you able to fine-tune or cache the templates?
I didn't spend the time. In this case a few seconds was acceptable.
The newer HTML::Template::Pro i wanted to trt did not compile on my machine however.
Gee, that's too bad. And I thought it was supposed to be the professional version! ;)
-sam
| [reply] |
Re: choosing the best templating system
by crenz (Priest) on Jul 06, 2005 at 11:48 UTC
|
Just to confuse you more :-), Mason would be another option, and of course Maypole, the new MVC kid on the block.
| [reply] |
Re: choosing the best templating system
by BaldPenguin (Friar) on Jul 06, 2005 at 14:47 UTC
|
| [reply] |