NAME
Egg::View::Template - HTML::Template is used for View of Egg.
SYNOPSIS
This is a setting example.
VIEW=> [
[ Template=> {
path=> [qw( /path/to/root /path/to/comp )],
cache=> 1,
global_vars=> 1,
die_on_bad_params=> 0,
... etc.
} ],
],
# Associate is set. The object with 'param' method.
$e->view->push_associate( $e->o );
# Filter is set.
$e->view->push_filter( ...filter code. );
When you want to use it individually.
my $mbody= $e->view->render('mail-body.tmpl', { foo=> 'baa' });
sendmail->method('toaddr@domain', 'subject', $mbody);
DESCRIPTION
The option that can be specified for HTML::Template
- strict
- global_vars
- cache
- shared_cache
- double_cache
- blind_cache
- die_on_bad_params
- vanguard_compatibility_mode
... etc.
Please see the document of HTML::Template in detail.
The parameter of default is taken from Egg::View::Template::Params.
Please treat %Egg::View::PARAMS when you want to set a fixed parameter arbitrarily.
Please see Egg::View in detail.
METHODS
$view->push_associate([OBJECT]);
Object that becomes a hint to bury the value under the template is set. Set object should have the param method.
$view->push_filter([filter code]);
Filter that processes the template beforehand is set. Please see the document of HT about the filter that can be set and the code.
$view->param([KEY], [VALUE]);
Set and refer to the parameter passed to HTML::Template.
$view->params
The HASH reference of parameter is returned.
SEE ALSO
HTML::Template, Egg::View, Egg::View::Template::Params, Egg::Release,
AUTHOR
Masatoshi Mizuno, <lushe@cpan.org>
COPYRIGHT AND LICENSE
Copyright (C) 2007 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.