NAME
Egg::View::TT - Template ToolKit is used for View of Egg.
SYNOPSIS
This is a setting example.
VIEW=> [
[ 'TT'=> {
INCLUDE_PATH=> [qw( /path/to/root /path/to/comp )],
TEMPLATE_EXTENSION=> '.tt',
},
],
],
Example of code.
$e->stash->{param1}= "fooooo";
$e->view->param( 'param2'=> 'booooo' );
# Scalar reference is received.
my $body= $e->view->render( 'template.tt' );
or
# It outputs it later.
$e->template( 'template.tt' );
Example of template.
[% INSERT html_header.tt %]
[% INSERT banner_head.tt %]
[% INSERT side_menu.tt %]
<h1>[% e.stash('param1') %]</h1>
<h2>[% param2 %]</h2>
<div id="content">
- Your request passing: [% e.request.path %]<hr>
- Your IP address: [% e.request.address %]<hr>
- Test Array:
[% FOREACH hash IN array %]
[ [% hash.name %] = [% hash.value %] ],
[% END %]
</div>
[% INSERT html_footer.tt %]
DESCRIPTION
e ... It can access the Egg object.
s ... It can access $e->stash.
METHODS
output ([EGG_OBJECT], [TEMPLATE], [TemplateToolKit OPTIONS])
The template is output, and it sets it in $e->response->body.
render ([TEMPLATE], [TemplateToolKit OPTIONS])
The template is output, and it returns it by the SCALAR reference.
SEE ALSO
http://www.template-toolkit.org/, Egg::View, Egg::Engine, Egg::Release,
AUTHOR
Masatoshi Mizuno, <lushe@cpan.org>
COPYRIGHT AND LICENSE
Copyright (C) 2006 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.