| 1 | package Tatsumaki::Template::Micro; | ||
| 2 | use Any::Moose; | ||
| 3 | extends 'Tatsumaki::Template'; | ||
| 4 | |||
| 5 | use Text::MicroTemplate::File; | ||
| 6 | has mt => (is => 'rw', isa => 'Text::MicroTemplate::File', handles => [ 'render_file' ]); | ||
| 7 | |||
| 8 | sub BUILD { | ||
| 9 | my $self = shift; | ||
| 10 | |||
| 11 | my $mt = Text::MicroTemplate::File->new( | ||
| 12 | include_path => [ 'templates' ], | ||
| 13 | use_cache => 0, | ||
| 14 | tag_start => '<%', | ||
| 15 | tag_end => '%>', | ||
| 16 | line_start => '%', | ||
| 17 | ); | ||
| 18 | |||
| 19 | $self->mt($mt); | ||
| 20 | }; | ||
| 21 | |||
| 22 | sub include_path { | ||
| 23 | my $self = shift; | ||
| 24 | $self->mt->{include_path} = shift if @_; | ||
| 25 | $self->mt->{include_path}; | ||
| 26 | } | ||
| 27 | |||
| 28 | 1; | ||
| 29 |