[Templates] Extending Template::Provider

Dominic Malolepszy dmalopsy@alpha.net.au
Sat, 14 Oct 2006 17:18:24 +1000


I wanted to create my own Provider in order to load templates from a 
database instead of using files. After reading bits and piece, I wrote a 
minimalist Provider just to test if it would work. Anyway it didn't :(

My existing file templates simply stopped loading after using the custom 
provider, so I decided to test whether loading the standard provider 
instance would work, and I got the same result.
I tried doing the following:

my $template = new Template({
         LOAD_TEMPLATES => [
            Template::Provider->new(),
         ],
         INCLUDE_PATH => './templates',
         INTERPOLATE  => 1,
         DEBUG => 1,
   });

so basically if I try to load my own instance of Template::Provider it 
stops serving templates from ./templates, it doesn't even throw any 
errors that it cannot find the files etc.
Also I tried enabling the DEBUG => 1 flag when creating my Template 
object, however where does the debug info get printed too?
Any suggestions/help would be greatly appreciated.

Cheers,

-- 

Dominic Malolepszy