Data, Logic, Display: The Multi-Tiered Decoupled Approach to Web
In Refining the CGI process through structure and templates
A good CGI framework should provide
1.Template handling -- go TT2! Keeping templates divorced from code allows me to to farm out HTML
and probably SQL, not to mention benefits of maintenance, etc
But one must ask. Does Template
force one to
separate Perl and HTML? The answer is no, it does not. In
fact, anything you can do in Perl, you can do using the
[% PERL %]
Furthermore, Template exports a mini-language,
containing loops and conditionals and simplified methods
of defining Perl hash and array refs. And beyond that,
people have written plugins to extend this mini-langauge
even further to support database interaction among other things.
So, with Template as your templating solution,
you have Perl and Template as programming languages and then
you have HTML.
On the other hand HTML::Template has far more
limited mini-language, forcing one to do much more in pure
Web App Frameworks and Their Chosen Template Engine
In my eyes, Template
is offering replicated functionality
through its too-powerful and too-feature-packed mini-language. There is
nothing that this mini-language offers that cannot and should not be done
in re-usable Perl modules.
On the other hand, HTML::Template by creating a very narrow
snake's tube between Perl computation and HTML display, forces one to use
Perl for it's strength and HTML for it's without any chance for the
feature overlap phenomenon that has happened with Template.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||