root/lang/perl/Nanto/trunk/lib/Nanto/View/TT.pm @ 10530

Revision 10530, 490 bytes (checked in by tokuhirom, 7 years ago)

Moose based web application framework.

Line 
1package Nanto::View::TT;
2use Moose;
3use String::CamelCase qw/decamelize/;
4use Template;
5use Carp;
6
7with 'Nanto::Role::View';
8
9has tt_instance => (
10    is      => 'rw',
11    isa     => 'Template',
12    default => sub { Template->new },
13);
14
15has tmpl_fname => (
16    is      => 'rw',
17    isa     => 'Str',
18    default => '',
19);
20
21sub output {
22    my ($self, ) = @_;
23
24    $self->tt_instance->process( $self->tmpl_fname, $self->params, \my $out ) or croak $self->tt_instance->error;
25    $out;
26}
27
281;
Note: See TracBrowser for help on using the browser.