WebNano::Renderer::TT - A Template Toolkit renderer for WebNano with dynamic search paths
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.
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
Postfix added to action name to form the template name ( for example 'edit.tt' from action 'edit' and TEMPLATE_EXTENSION 'tt' ).
Zbigniew Lukasiak <firstname.lastname@example.org>
This software is Copyright (c) 2010 by Zbigniew Lukasiak <email@example.com>.
This is free software, licensed under:
The Artistic License 2.0