/[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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 23 by dpavlin, Sun Jun 29 16:24:41 2008 UTC revision 32 by dpavlin, Sun Jun 29 20:52:33 2008 UTC
# Line 5  use warnings; Line 5  use warnings;
5    
6  use Time::HiRes qw/time/;  use Time::HiRes qw/time/;
7  use Data::Dump qw/dump/;  use Data::Dump qw/dump/;
8  use Carp qw/confess/;  use Carp qw/confess carp/;
9    
10  =head1 NAME  =head1 NAME
11    
# Line 19  Frey::HTML - generate html pages Line 19  Frey::HTML - generate html pages
19    
20  our @view_classes = qw(  our @view_classes = qw(
21          Frey::View          Frey::View
         Frey::REST  
22          Strix::View          Strix::View
23  );  );
24    
# Line 47  Template::Declare->init( roots => \@view Line 46  Template::Declare->init( roots => \@view
46                          title { $path }                          title { $path }
47                          link {                          link {
48                                  { rel is 'stylesheet' }                                  { rel is 'stylesheet' }
49                                  { href is 'static/app.css' }                                  { href is '/static/app.css' }
50                                  { type is 'text/css' }                                  { type is 'text/css' }
51                                  { media is 'screen' }                                  { media is 'screen' }
52                          };                          };
53                          foreach my $js ( @javascript ) {                          foreach my $js ( @javascript ) {
54                                  script {                                  script {
55                                          { type is 'text/javascript' }                                          { type is 'text/javascript' }
56                                          { src is $js }                                          { src is "/$js" }
57                                  }                                  }
58                          }                          };
59                  }                  }
60                  body {                  body {
61                          $orig->();                          $orig->();
# Line 74  Wrap template into html page Line 73  Wrap template into html page
73  =cut  =cut
74    
75  sub page {  sub page {
76          my $self = shift;          my ( $self, $page, $req, $args ) = @_;
77          warn "## page $_[0]\n";          warn "## page $page ",dump($args),"\n";
78          return Template::Declare->show( @_ );          my $out = eval { Template::Declare->show( $page, $req, $args ) };
79            if ( $@ ) {
80                    carp "ERROR: $@";
81                    $out = Template::Declare->show( 'error', $req, "page $page " . dump($args) . ": $@" );
82            }
83            return $out;
84  }  }
85    
86  =head2 add_javascript  =head2 add_javascript

Legend:
Removed from v.23  
changed lines
  Added in v.32

  ViewVC Help
Powered by ViewVC 1.1.26