Template::Caribou::Files - Role to load templates from files
version 0.2.3
package MyTemplate; use Moose; with 'Template::Caribou'; with 'Template::Caribou::Files' => { dirs => [ 'my_templates/' ], auto_reload => 1, }; 1;
With Template::Caribou::Files, a Caribou class will automatically import all template file (i.e., all files with a .bou extension) under the given directories.
.bou
The names of the imported templates will be their path, relative to the imported directories, without their extension. To take the example in the "SYNOPSIS", if the content of my_templates/ is:
my_templates/
./foo.bou ./bar.bou ./baz/frob.bou
then the templates foo.bou, bar.bou and baz/frob will be created.
foo.bou
bar.bou
baz/frob
Imports the content of $file as a template. If $name is not given, it is assumed to be the basename of the file, minus the extension.
Returns the name of the imported template.
The array ref of directories to scan for templates.
If set to true, the import directories will be rescanned and every file re-imported before every call to render. Useful during development.
render
Defaults to false.
Yanick Champoux <yanick@cpan.org>
This software is copyright (c) 2013 by Yanick Champoux.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Template::Caribou, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Template::Caribou
CPAN shell
perl -MCPAN -e shell install Template::Caribou
For more information on module installation, please visit the detailed CPAN module installation guide.