[Israel.pm] Dancer templates

sawyer x xsawyerx at gmail.com
Tue Mar 15 07:05:14 PDT 2011


Hey Ynon.

There's the "auto_pages" option, which does just that, but in a clean way.

On Tue, Mar 15, 2011 at 3:48 PM, ynon perek <ynonperek at gmail.com> wrote:

> 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
>
>
> _______________________________________________
> Perl mailing list
> Perl at perl.org.il
> http://mail.perl.org.il/mailman/listinfo/perl
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.perl.org.il/pipermail/perl/attachments/20110315/59281fc1/attachment.htm 


More information about the Perl mailing list