Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

HTML::Template to Template Toolkit

by artist (Parson)
on Mar 08, 2006 at 15:36 UTC ( [id://535190]=perlquestion: print w/replies, xml ) Need Help??

artist has asked for the wisdom of the Perl Monks concerning the following question:

Dear Monks,
I am looking for a lazy way to convert my templates to be used with Template Toolkit rather than HTML::Template as they were previously written for.

Thanks,

--Artist

Replies are listed 'Best First'.
Re: HTML::Template to Template Toolkit
by kutsu (Priest) on Mar 08, 2006 at 19:38 UTC

    There a simple filter for Template::Toolkit (Template::Plugin::HTML::Template) that will allow HTML::Template like objects. As for a HTML::Template <-> Template::Toolkit converter that shouldn't be too hard to write, at least for most basic functions. Though I too wonder why you would need this; esp. since a number of function just don't exist in HTML::Template so you'll have to write those anyway should be a simple matter to also convert.

      TThanks Kutsu:
      The filter, you mentioned, is useful to me. I like to convert my templates so I can use them with 'Template Toolkit' which has more functionality. I wanted to convert because I can put more stuff into templates in future. I think that, you thought the other way around.
      --Artist
Re: HTML::Template to Template Toolkit
by InfiniteSilence (Curate) on Mar 08, 2006 at 16:23 UTC
    I don't have an answer to your question, but I was wondering why you would want to do this? I have read (the nathan macfarland post) someone's comments on switching over but your description doesn't explain what you want to actually do with TT.

    Celebrate Intellectual Diversity

Re: HTML::Template to Template Toolkit
by isync (Hermit) on May 19, 2015 at 20:58 UTC
    For posterity, there is a lazy way, to translate HTML::Template (H::T) to Template Toolkit (TT) syntax:
    use HTML::Template::Convert::TT; print convert($ARGV[0]);

Log In?
Username:
Password:

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

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

    No recent polls found