1 package Reaction::UI::View::TT;
4 use aliased 'Reaction::UI::View';
7 class TT is View, which {
9 has '_tt' => (isa => 'Template', is => 'rw', lazy_fail => 1);
11 implements 'BUILD' => as {
12 my ($self, $args) = @_;
13 my $tt_args = $args->{tt}||{};
14 $self->_tt(Template->new($tt_args));
17 overrides 'layout_set_args_for' => sub {
19 return (super(), tt_object => $self->_tt);
22 overrides 'rendering_context_args_for' => sub {
23 my ($self, %args) = @_;
24 return (super(), tt_view => $args{layouts}->tt_view);
27 implements 'serve_static_file' => as {
28 my ($self, $c, $args) = @_;
29 foreach my $path (@{$self->search_path_for_type('web')}) {
30 my $cand = $path->file(@$args);
32 $c->serve_static_file($cand);