| CPAN Ratings (Gamma) HTML-Template reviews | |
| Home | Search | About | Login |
RSS | Module Info | Add a review of HTML-Template
4 out of 4 found this review helpful:
I've used HTML::Template in a couple of jobs and found that as soon as you leave non-trivial templating it becomes extremely limiting and requires more and more data munging in the code using the templates in order to get everything into a hash of arrays of hashes shaped data set.
For simple templating such as trivial email, cgi scripts or configuration files it works very well.
In almost all non-trivial work however it is extremely limiting and is best replaced by Template Toolkit. I've used both, and will no longer use HTML::Template at the start of the project because it can involve so much work moving later when you are stuck with the mess required to acheive anything non-trivial with HTML::Template.
In summary, 80% of the time you want to use Template Toolkit instead, and the other 20% of the time, H::T doesn't offer any benefits over TT.
Aaron Trevena - 2006-12-22 08:33:58
Was this review helpful to you?
Yes
No
HTML::Template is allegedly fine for simple stuff but rapidly gets unmaintainable when you want to do anything more complicated. Maybe you're only doing simple stuff now, but chances are, later you won't be.
Problems I've come across resulting directly from H::T's design decisions in a large templated application include:
* No dot notation, so you end up flattening your data structures. We prefix related keys like "USER_" instead of being able to pass in a hash "USER" and work on that.
* No expressions, so you can't, say, select a tab if its name is the same as another variable. Instead you have to preprocess the list on the perl side and add a variable "selected". If you want to highlight every other row in a list then preprocess in Perl! After all, if you wanted separation of business and display logic, you'd use a templating system.
* No dot notation means you can't handily use objects, hashes, arrays.
* Lack of object access or plugins means you can't easily do localisation in the template and instead have to preprocess in Perl.
* Filtering isn't plugable. You have "ESCAPE=HTML" and "ESCAPE=JS" and, er, that's your lot. I guess you could preprocess in Perl.
* The default (and therefore most commonly used) tags are <> which means it gets highlighted wrongly by most editors, and ignored by the web browser if viewed un-processed, making it harder to debug. Yet the syntax isn't valid XML.
Some of these deficiencies are fixed by HTML::Template::Expr (which apparently the author disapproves of) and various modules which add dot notation, expressions, plugins and the like.
Or you could just use Template::Toolkit which is as easy to use for the simple stuff, and infitely less frustrating for everything else.
osfameron - 2006-10-19 03:09:47
Was this review helpful to you?
Yes
No
Awesome module. Very powerful, good & solid code and interface and I especially love how CGI::Application uses it and it's my safety sandbox from tainting my template code with business logic code.
Jason Purdy - 2006-03-31 14:20:22
Was this review helpful to you?
Yes
No
This module does what it's supposed to do very, very well. It's well documented and simple to use. And if you hate complex logic in your templates this is a good place to go. Logic is severely restricted.
I however often have complex presentation logic, and I find when using this module I end up writing a lot of perl code to fix the template display . When I create a separate module just for HTML::Template display logic the temptation to add business logic in is great. And if someone succumbs to that temptation then you are back to HTML Mason style situation -- only instead of mixing your biz and presentation logic in an HTML page, you are doing it in a perl module. Anyhow I find that using a larger template language like Template toolkit's allows me to cleanly separate business and presentation logic - allowing me to do presentation logic in the presentation layer, and biz logic in the perl modules.
As always: "Your milage may vary".
nathan mcfarland - 2005-11-17 08:19:04
Was this review helpful to you?
Yes
No
I can find no flaws. It just does its job, exactly as advertised, in a straightforward manner. Yay!
Shawn Boyette - 2004-08-20 16:56:56
Was this review helpful to you?
Yes
No
Dont leave home without it! Its an indispensable part of my toolkit.
Stevan Little - 2004-06-04 10:15:16
Was this review helpful to you?
Yes
No
Great module! It lets me separate my code from my HTML. The template syntax is straight forward. I like the fact that it can do some introspection (see query() method). I only wish it could handle sending objects directly to the template out of the box.
Brian Cassidy - 2004-06-04 07:52:21
Was this review helpful to you?
Yes
No
HTML::Template does exactly what I need. It allows me to seperate the presentation from my code and isn't at all complex. It has a simple syntax with easy to understand documentation and examples. It gives you just enough of what you need without so much that you'd need a book to learn it thoroughly. There are also HTML::Template extension PMs you can find on CPAN that will let you integrate some degree of code or evaluations and calculations in your templates (if you're into that sort of thing).
HTML::Template was perfect for pulling the presentation part of my existing complex and details project into its own layer without making any sacrifices or major changes in the code itself. I've looked at HTML::Mason and Template::Toolkit and would certainly consider them under different circumstances, but for my needs HTML::Template is *perfect*.
n/a - 2004-06-03 05:13:37
Was this review helpful to you?
Yes
No
Great tool HTML for templating. Only problem is that it's difficult to make web pages compliant with WYSWYG editors.
Michele Beltrame - 2004-05-17 07:05:53
Was this review helpful to you?
Yes
No
It is easily too used and it is the best partition between HTML and
Perl.
Tobias Mat. - 2004-05-08 09:03:50
Was this review helpful to you?
Yes
No
Simple, fast, efficient, powerful.
Gunnar Wolf - 2004-04-20 09:38:48
Was this review helpful to you?
Yes
No
This is an excellent module for truely separating HTML design from perl coding. From reading the other reviews, I agree that it is not as complex as Mason or Template Toolkit, but that is what I like about it. Keep it simple! HTML designers can quite easily pick it up without knowing anything about programming. It is a great templating system from beginners to advanced web developers who want to keep their perl code clean and their web sites easy to maintain.
Spencer Christensen - 2004-04-15 09:33:41
Was this review helpful to you?
Yes
No
Note: this review applies to earlier versions of HTML::Template.
This is an excellent module. This one has made web application development much easier for me.
The only downside is with using simple loops with one value. It seems like a kluge to have to convert an array into a hash. It's also awkward to specify a "default" option for select lists. These are both common issues that I think deserve implementation in the module.
Robert Rothenberg - 2004-01-03 13:07:46
Was this review helpful to you?
Yes
No
HTML::Template does exactly what I need and does it well. Can't ask for anything better than that. Extremely easy to use, fast, mature, stable. If your templating needs do not extend to one of the heavyweights (Mason, Template Toolkit), then you really can't go wrong with HTML::Template.
Kevin Spencer - 2004-01-01 16:39:03
Was this review helpful to you?
Yes
No
HTML::Template is a worthwhile tool for templating, and developing web applications, especially when used in conjunction with CGI::Application. However, since the templating language is light-weight, you may likely run into walls when attempting anything fairly involved (i.e., 'ELSIF' is missing). HTML::Template is useful if your needs are not too great, otherwise you might take a look at HTML::Mason.
Adam J. Foxson - 2003-08-26 13:14:40
Was this review helpful to you?
Yes
No
Excellent module that can by used in many different projects! Template language might be a bit too limited for some....
Jasper Cramwinckel - 2003-08-18 06:10:45
Was this review helpful to you?
Yes
No
HTML::Template is more than just a Perl module: it's a very simple and very clean templating syntax, perfect for an easy separation of code and presentation. And it's also available in other programming languages (Java, PHP, Python, Ruby and even Lisp), which is a real plus because you can share the same templates between web designers, Perl developpers and (for example) Java developpers.
S�bastien Aperghis-Tramoni - 2003-08-13 17:09:38
Was this review helpful to you?
Yes
No
This module enforces a useful seperation of code and design by providing a minimal amount of template logic in the templates. Easy to learn, built for speed, and very powerful. I use it quite frequently, even as template solution for non-HTML text. It is mature, with several extension modules available, plus ports to several other programming languages. Highly recommended.
Mark Stosberg - 2003-08-13 16:53:05
Was this review helpful to you?
Yes
No
|
Perl.org sites
: bugs
| dev
| history
| jobs
| learn
| lists
| use
Site Information and Contacts |
|