This commit is contained in:
Ask Bjørn Hansen committed 2008-11-09 18:52:26 -08:00
1 parent f20d1b240a
commit 79f7aa77f2
1 file changed
+8 -7
+8 -7
View File
@@ -7,9 +7,7 @@ use base 'Mojo::Base';
use Template (); use Template ();
use Carp (); use Carp ();
__PACKAGE__->attr('tt', __PACKAGE__->attr('tt', chained => 1,);
chained => 1,
);
sub new { sub new {
@@ -39,7 +37,7 @@ sub _init {
ABSOLUTE => 1, ABSOLUTE => 1,
); );
$self->tt(Template->new( \%config )) $self->tt(Template->new(\%config))
or Carp::croak "Could not initialize Template object: $Template::ERROR"; or Carp::croak "Could not initialize Template object: $Template::ERROR";
return $self; return $self;
@@ -52,14 +50,17 @@ sub _render {
#warn dump(\@args); #warn dump(\@args);
my $output; my $output;
unless ( $self->tt->process( $path, unless (
$self->tt->process(
$path,
{ c => $c, { c => $c,
tx => $tx, tx => $tx,
}, },
\$output, \$output,
{ binmode => ":utf8" } {binmode => ":utf8"}
) )
) { )
{
Carp::carp $self->tt->error . "\n"; Carp::carp $self->tt->error . "\n";
return $self->tt->error; return $self->tt->error;
} }