Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Browser-viewable HTML::Template templates

by Aristotle (Chancellor)
on Jan 12, 2003 at 02:43 UTC ( [id://226190]=note: print w/replies, xml ) Need Help??


in reply to Browser-viewable HTML::Template templates

Yuck. If you have to synchronize the template with the code, why use a template at all?

If you ask me, the best solution is to switch to Template Toolkit 2 and do something like this:

[% IF foo_checked ; '<input type=checkbox name="foo" checked>' ; ELSE +-%] <input type=checkbox name="foo">[% END %]
And you can also change the tag delimiters so that you can make it look f.ex like so:
<!--// IF foo_checked ; '<input type=checkbox name="foo" checked>' ; E +LSE --> <input type=checkbox name="foo"><!--// END -->
That way the browser sees valid HTML and the template can still generate either variant. HTML::Template ain't bad, but its syntax is really too restrictive IMHO.

Makeshifts last the longest.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (3)
As of 2024-04-20 01:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found