/[Frey]/trunk/lib/Frey/HTML.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /trunk/lib/Frey/HTML.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 10 - (hide annotations)
Sat Jun 28 22:13:05 2008 UTC (14 years, 7 months ago) by dpavlin
Original Path: trunk/lib/HTML.pm
File size: 625 byte(s)
cpeanup and spit html generation into own package

- time template generation
- wrap pages in html/head/body
- cleanup server and move logic there
1 dpavlin 10 package HTML;
2    
3     use strict;
4     use warnings;
5    
6     use Time::HiRes qw/time/;
7     use Data::Dump qw/dump/;
8     use View;
9    
10     use Data::Dump qw/dump/;
11    
12     warn "available templates = ",dump( Template::Declare->templates );
13    
14     use Template::Declare;
15     use Template::Declare::Tags; # defaults to 'HTML'
16     Template::Declare->init( roots => ['HTML','View'], around_template => sub {
17     my ($orig, $path, $args, $code) = @_;
18     my $t = time;
19     html {
20     head {}
21     body {
22     $orig->();
23     }
24     }
25     warn "TEMPLATE $path ",dump($args),sprintf(" in %.4fs\n",time - $t);
26     });
27    
28     sub view {
29     # warn "## view",dump( @_ );
30     my $self = shift;
31     return Template::Declare->show( @_ );
32     }

  ViewVC Help
Powered by ViewVC 1.1.26