WebNano::Renderer::TT - A Template Toolkit renderer for WebNano with dynamic search paths
version 0.002
use WebNano::Renderer::TT; $renderer = WebNano::Renderer::TT->new( root => [ 't/data/tt1', 't/data/tt2' ] ); $out = ''; $renderer->render( template => 'template.tt', search_path => [ 'subdir1', 'subdir2' ], output => \$out );
This is experimental Template Tookit dynamic renderer for WebNano. Please note that you can use Template Tookit directly in WebNano without this module, what this module adds is way to search for the templates that depends on the controller. When looking for a template file it scans a cartesian product of static set of paths provided at instance creation time and stored in the root attribute and a dynamic set provided to the render method in the search_path attribute. Additionally it also scans the INCLUDE_PATH in a more traditional and non-dynamic way.
root
render
search_path
INCLUDE_PATH
A mechanism to provide the serach path directly sidestepping the dynamic calculations.
Templates that are to be found in INCLUDE_PATH are universal - i.e. can be INCLUDEd everywhere.
INCLUDE
Postfix added to action name to form the template name ( for example 'edit.tt' from action 'edit' and TEMPLATE_EXTENSION 'tt' ).
Zbigniew Lukasiak <zby@cpan.org>
This software is Copyright (c) 2010 by Zbigniew Lukasiak <zby@cpan.org>.
This is free software, licensed under:
The Artistic License 2.0
To install WebNano::Renderer::TT, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WebNano::Renderer::TT
CPAN shell
perl -MCPAN -e shell install WebNano::Renderer::TT
For more information on module installation, please visit the detailed CPAN module installation guide.