Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^2: mini-languages for MVC view/controller manipulation

by simonm (Vicar)
on Dec 28, 2004 at 07:44 UTC ( #417714=note: print w/ replies, xml ) Need Help??


in reply to Re: mini-languages for MVC view/controller manipulation
in thread mini-languages for MVC view/controller manipulation

This doesn't seem like much of a problem; either leave the extra whitespace out of your source files, or mark the extra lines in some way and remove them before processing.

Version one looks like this:

Hi <TMPL_IF foo><TMPL_INCLUDE foo.txt> </TMPL_IF>Hello

Version two looks like this:

Hi \ <TMPL_IF foo>\ <TMPL_INCLUDE foo.txt> </TMPL_IF>\ \ Hello
... $in =~ s/\\\n[\t ]*//g; ...

Doesn't this same issue apply to most templating packages, or am I missing something about why this is more of an issue for HTML::Template than the others?


Comment on Re^2: mini-languages for MVC view/controller manipulation
Select or Download Code
Re^3: mini-languages for MVC view/controller manipulation
by hardburn (Abbot) on Dec 28, 2004 at 14:13 UTC

    Doesn't this same issue apply to most templating packages . . . ?

    Probably. If there is anything special about H::T, it's that its default tag syntax is a bit lengthy. Compare to Text::BasicTemplate:

    Hi %if foo%include%fi% Hello

    (Note that Text::BasicTemplate doesn't have an equivilent to TMPL_INCLUDE by default, though it can call out to Perl subroutines.)

    That's a much more condensed example that, IMHO, works better for plaintext.

    "There is no shame in being self-taught, only in not trying to learn in the first place." -- Atrus, Myst: The Book of D'ni.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://417714]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (6)
As of 2014-09-21 09:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (168 votes), past polls