Egg::View::TT - View for TemplateToolKit.
__PACKAGE__->egg_startup( ... ..... VIEW=> [ [ 'TT' => { INCLUDE_PATH=> ['/path/to/root'], } ], ], ); # The VIEW object is acquired. my $view= $e->view('TT'); # It outputs it specifying the template. my $content= $view->render('hoge.tt', \%option);
It is a view for TemplateToolKit.
http://www.template-toolkit.org/
Please add TT to the setting of VIEW to make it use.
VIEW=> [ [ 'TT' => { ... TemplateToolKit option. (HASH) } ],
The object that can be used is as follows from the template.
e ... Object of project. s ... $e->stash p ... $e->view('TT')->params
Egg::View has been succeeded to.
Constructor.
Egg::View::Template::GlobalParam is set up.
my $view= $e->view('TT');
The result of evaluating the template of TEMPLATE_STR with TemplateToolKit is returned by the SCALAR reference.
OPTION is an option to pass to TemplateToolKit. OPTION overwrites a set value of the configuration.
my $body= $view->render( 'foo.tt', .......... .... );
The result of the render method is set in $e->response->body.
When TEMPLATE is omitted, it acquires it from $view->template.
OPTION is passed to the render method as it is.
$view->output;
Egg::Release, Egg::View, Egg::View::Template::GlobalParam, Template, http://www.template-toolkit.org/,
Masatoshi Mizuno <lushe@cpan.org>
Copyright (C) 2008 by Bee Flag, Corp. <http://egg.bomcity.com/>, All Rights Reserved.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.6 or, at your option, any later version of Perl 5 you may have available.
To install Egg::View::TT, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Egg::View::TT
CPAN shell
perl -MCPAN -e shell install Egg::View::TT
For more information on module installation, please visit the detailed CPAN module installation guide.