Apache-Template
view release on metacpan or search on metacpan
lib/Apache/Template.pm view on Meta::CPAN
10931094109510961097109810991100110111021103110411051106110711081109111011111112custom service module. The following trivial example shows how you
might subclass Template::Service::Apache to add an additional parameter,
in this case as the template variable
'message'
.
<perl>
sub
params {
my
$self
=
shift
;
my
$params
=
$self
->SUPER::params(
@_
);
$params
->{ message } =
'Hello World'
;
return
$params
;
}
</perl>
PerlModule Apache::Template
TT2ServiceModule My::Service::Module
=back
lib/Template/Service/Apache.pm view on Meta::CPAN
193194195196197198199200201202203204205206207208209210211212213my
$rootcfg
= {
ABSOLUTE
=> 1,
map
{
exists
$config
->{
$_
} ? (
$_
,
$config
->{
$_
}) : () }
qw( COMPILE_DIR COMPILE_EXT CACHE_SIZE PARSER )
,
};
my
$rootprov
= Template::Config->provider(
$rootcfg
)
||
return
$self
->error(Template::Config->error());
# now let the Template::Service superclass initialiser continue
$self
->SUPER::_init(
$config
)
||
return
undef
;
# save reference to root document provider
$self
->{ ROOT_PROVIDER } =
$rootprov
;
# determine content type or use default
$self
->{ CONTENT_TYPE } =
$config
->{ CONTENT_TYPE } ||
$CONTENT_TYPE
;
# if TT2Headers not explicitly defined then we default it to
( run in 0.295 second using v1.01-cache-2.11-cpan-454fe037f31 )