8 |
use Carp qw/confess/; |
use Carp qw/confess/; |
9 |
|
|
10 |
# FIXME |
# FIXME |
11 |
use View; |
|
12 |
use Strix::View; |
our @view_classes = qw( |
13 |
use Frey::REST; |
Frey::View |
14 |
|
Frey::REST |
15 |
|
Strix::View |
16 |
|
); |
17 |
|
|
18 |
|
warn "Using view classes ", dump( @view_classes ); |
19 |
|
|
20 |
|
foreach ( @view_classes ) { |
21 |
|
my $path = $_; |
22 |
|
$path =~ s!::!/!g; |
23 |
|
$path .= '.pm'; |
24 |
|
require $path or warn "Can't require $_ from $path: $!"; |
25 |
|
} |
26 |
|
|
27 |
warn "available templates = ",dump( Template::Declare->templates ); |
warn "available templates = ",dump( Template::Declare->templates ); |
28 |
|
|
30 |
|
|
31 |
use Template::Declare; |
use Template::Declare; |
32 |
use Template::Declare::Tags; # defaults to 'HTML' |
use Template::Declare::Tags; # defaults to 'HTML' |
33 |
Template::Declare->init( roots => ['HTML','View'], around_template => sub { |
Template::Declare->init( roots => \@view_classes, around_template => sub { |
34 |
my ($orig, $path, $args, $code) = @_; |
my ($orig, $path, $args, $code) = @_; |
35 |
my $t = time; |
my $t = time; |
36 |
html { |
html { |