three18ti has asked for the wisdom of the Perl Monks concerning the following question:
Hello
I would like to include some templates with a Module I am developing, but I'm not sure how I would include them such that when the module is installed the templates are accessible.
I use Dist::Zilla to mint the skeleton and build/test/release the module.
So if I put my templates in lib/Foo/Templates/*.tt, what parameter to I feed my Template->new to to tell it to search in the $default_locations/Foo/Templates/? Ideally, I would prefer not to have to specify all the locations, because there are a number of pitfalls with that solution (what if module is installed in non standard location, what if a windows user installs the module, etc.)
I think this is what tells it to search my local build directory:
my $tt = Template->new({ INCLUDE_PATH => ['lib/Foo/Templates'], }) || die "$Template::ERROR\n";
Thanks Monks!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Distributing/Accessing Template::Toolkit Templates
by GrandFather (Saint) on Nov 05, 2013 at 08:26 UTC | |
by three18ti (Monk) on Nov 10, 2013 at 18:57 UTC | |
by GrandFather (Saint) on Nov 10, 2013 at 21:16 UTC | |
|
Re: Distributing/Accessing Template::Toolkit Templates (File::ShareDir)
by Anonymous Monk on Nov 05, 2013 at 08:37 UTC |