[Israel.pm] Dancer templates

ynon perek ynonperek at gmail.com
Tue Mar 15 06:48:15 PDT 2011


Hi Everyone,

Playing with Dancer, I was trying to have it automatically render templates
by name.

I can make it work by doing the following, but was wondering if anyone has a
better way.

find( sub {
        return if ! /[.]tt$/;

        my $path = $1 if $File::Find::name =~ m{[.]/views(.*)[.]tt$};

        get $path => sub {
            template $path;
        };
    }, './views');

dance;

Cheers,
  Ynon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.perl.org.il/pipermail/perl/attachments/20110315/91df1bf7/attachment.htm 


More information about the Perl mailing list