CGI-Application-Plugin-AnyTemplate
view release on metacpan or search on metacpan
lib/CGI/Application/Plugin/AnyTemplate.pm view on Meta::CPAN
}
}
# Get the string, if supplied
my $string_ref;
if (exists $plugin_config->{'string'}) {
$string_ref = $plugin_config->{'string'} || '';
$string_ref = \$string_ref unless ref $string_ref;
}
# if no string, then guess template filename
my $filename;
unless ($string_ref) {
$filename = $self->_guess_template_filename($plugin_config, \%driver_config, $type, $self->{'webapp'}->get_current_runmode);
}
# call load_tmpl hook
my %tmpl_params;
if ($self->{'webapp'}->can('call_hook')) {
my %ht_params = (
'path' => $plugin_config->{'add_include_paths'},
);
$self->{'webapp'}->new_hook('load_tmpl');
lib/CGI/Application/Plugin/AnyTemplate.pm view on Meta::CPAN
my $module = (ref $self) . '::Driver::' . $driver;
eval "require $module";
if ($@) {
croak "CAP::AnyTemplate: template driver $module could not be found: $@";
}
return $module;
}
sub _guess_template_filename {
my ($self, $plugin_config, $driver_config, $type, $crm) = @_;
my $filename;
if (exists $plugin_config->{'file'}) {
$filename = $plugin_config->{'file'};
}
else {
# filename set to current run mode
$filename = $crm;
( run in 1.311 second using v1.01-cache-2.11-cpan-748bfb374f4 )