Zbigniew Łukasiak

NAME

WebNano::Renderer::TT - A Template Toolkit renderer for WebNano with dynamic search paths

VERSION

version 0.002

SYNOPSIS

    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 );

DESCRIPTION

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.

ATTRIBUTES

root

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.

TEMPLATE_EXTENSION

Postfix added to action name to form the template name ( for example 'edit.tt' from action 'edit' and TEMPLATE_EXTENSION 'tt' ).

METHODS

render

new

AUTHOR

Zbigniew Lukasiak <zby@cpan.org>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2010 by Zbigniew Lukasiak <zby@cpan.org>.

This is free software, licensed under:

  The Artistic License 2.0



Hosting generously
sponsored by Bytemark