/[Frey]/trunk/lib/Frey/View.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

Contents of /trunk/lib/Frey/View.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 26 - (show annotations)
Sun Jun 29 18:08:50 2008 UTC (15 years, 10 months ago) by dpavlin
File size: 1044 byte(s)
another refacture and version bump [0.02]
- added support for error pages
- added list of classes
1 package Frey::View;
2
3 use strict;
4 use warnings;
5
6 use Template::Declare::Tags; # defaults to 'HTML'
7 use Frey;
8 use base qw/Template::Declare/;
9 use Data::Dump qw/dump/;
10 use Carp qw/carp/;
11
12 sub debug_dump {
13 my $dump = dump( @_ );
14 carp "debug_dump $dump\n";
15 pre {
16 { class is 'debug' }
17 outs $dump;
18 }
19 }
20
21 template 'status' => sub {
22 my ( $self ) = @_;
23 p { 'Welcome to Frey' }
24 show( 'templates' );
25 show( 'classes' );
26 };
27
28 template 'templates' => sub {
29 h1 { 'Available templates' };
30 my $templates = Template::Declare->templates;
31 debug_dump( $templates );
32 ul {
33 foreach my $pkg ( keys %$templates ) {
34 li {
35 outs $pkg;
36 ul {
37 foreach my $template ( @{ $templates->{$pkg} } ) {
38 li {
39 a {
40 { href is "/$pkg/$template" }
41 $template
42 }
43 }
44 }
45 }
46 }
47 }
48 }
49 };
50
51 template 'classes' => sub {
52 my $self = shift;
53 h1 { 'All classes in image' };
54 my $f = Frey->new;
55 debug_dump( $f->classes );
56 };
57
58 template 'error' => sub {
59 my $self = shift;
60 p {
61 { class is 'error' }
62 outs( @_ );
63 }
64 };
65
66 1;

  ViewVC Help
Powered by ViewVC 1.1.26