4 |
use warnings; |
use warnings; |
5 |
|
|
6 |
use Template::Declare::Tags; # defaults to 'HTML' |
use Template::Declare::Tags; # defaults to 'HTML' |
7 |
use base 'Template::Declare'; |
use Frey; |
8 |
|
use base qw/Template::Declare/; |
9 |
use Data::Dump qw/dump/; |
use Data::Dump qw/dump/; |
10 |
|
use Carp qw/carp/; |
11 |
|
|
12 |
template status => sub { |
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 ) = @_; |
my ( $self ) = @_; |
23 |
p { 'Welcome to Frey' } |
p { 'Welcome to Frey' } |
24 |
|
show( 'templates' ); |
25 |
|
show( 'classes' ); |
26 |
|
}; |
27 |
|
|
28 |
|
template 'templates' => sub { |
29 |
h1 { 'Available templates' }; |
h1 { 'Available templates' }; |
30 |
my $templates = Template::Declare->templates; |
my $templates = Template::Declare->templates; |
31 |
warn "templates = ",dump( $templates ); |
debug_dump( $templates ); |
32 |
ul { |
ul { |
33 |
foreach my $pkg ( keys %$templates ) { |
foreach my $pkg ( keys %$templates ) { |
34 |
li { |
li { |
46 |
} |
} |
47 |
} |
} |
48 |
} |
} |
|
pre { |
|
|
{ class is 'debug' } |
|
|
outs dump( Template::Declare->templates ) |
|
|
} |
|
49 |
}; |
}; |
50 |
|
|
51 |
template 'refresh_modules' => sub { |
template 'classes' => sub { |
52 |
Module::Refresh->refresh; |
my $self = shift; |
53 |
p { 'Modules refreshed' } |
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; |
1; |