Apache-Template
view release on metacpan or search on metacpan
lib/Apache/Template.pm view on Meta::CPAN
custom 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>
package My::Service::Module;
use base qw( Template::Service::Apache );
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
my $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.575 second using v1.01-cache-2.11-cpan-49f99fa48dc )