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 <ynonpe...@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@perl.org.il > http://mail.perl.org.il/mailman/listinfo/perl >
_______________________________________________ Perl mailing list Perl@perl.org.il http://mail.perl.org.il/mailman/listinfo/perl