+
+ unless ($self->{tt}) {
+ my $view_options = $r->config->view_options || {};
+ (my $driver_name = ref $r) =~ s/::/_/g;
+ my $compile_dir = catdir(tmpdir(), $driver_name);
+ $self->{provider} = Template::Provider->new(
+ COMPILE_DIR => $compile_dir,
+ %$view_options,
+ );
+ $self->{tt} = Template->new({
+ COMPILE_DIR => $compile_dir,
+ %$view_options,
+ LOAD_TEMPLATES => [ $self->{provider} ],
+ });
+ }
+
+ $self->{provider}->include_path([ $self->paths($r) ]);
+