1 package Reaction::UI::View::TT;
4 use aliased 'Reaction::UI::View';
7 use namespace::clean -except => [ qw(meta) ];
12 has '_tt' => (isa => 'Template', is => 'rw', lazy_fail => 1);
14 my ($self, $args) = @_;
15 my $tt_args = $args->{tt}||{};
16 $self->_tt(Template->new($tt_args));
18 override 'layout_set_args_for' => sub {
20 return (super(), tt_object => $self->_tt);
22 sub layout_set_file_extension { 'tt' };
23 sub serve_static_file {
24 my ($self, $c, $args) = @_;
25 foreach my $path (@{$self->search_path_for_type('web')}) {
26 my $cand = $path->file(@$args);
28 $c->serve_static_file($cand);
35 __PACKAGE__->meta->make_immutable;