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

How to use HTML::Template instead of EP template in Mojolicious?

Replies are listed 'Best First'.
Re: Mojolicious and HTML::Template
by davido (Cardinal) on Jul 26, 2011 at 08:47 UTC

    I haven't tried using an alternate templating system, with Mojolicious, though I've been considering it. ...just haven't found a need compelling enough to try it.

    But there is some documentation on the topic here: Mojolicious:Guides:Rendering:Adding Your Favorite Template System.

    The synopsis there looks pretty straightforward, which is one of the elegant things about Mojolicious. But I'm sure I'm missing out on what the complexities are until I've tried. ;) At any rate, have a look at the notes in that link to brainstorm for some ideas.


    Dave

Re: Mojolicious and HTML::Template
by Anonymous Monk on Jul 26, 2011 at 07:27 UTC

    How to use HTML::Template instead of EP template in Mojolicious?

    I don't understand the question :)

    What is wrong with this?

    my $template = HTML::Template->new(filename => 'test.tmpl'); ...

      What's wrong with it? Mojolicious is a framework that does the template locating and rendering for you, so a normal user of the framework never both with initializing a template object.

      Instead one write a Mojolicious::Plugin::HTMLTemplateRenderer plugin which does all the rendering boilerplate, and then just use this plugin in the mojolicious application.

      I've never written such a plugin, but there are plenty examples on CPAN that you can use as templates.

        Thank You! That is what i need!