- or download this
if (template address exists) {
include template
} else {
include other template
}
- or download this
sub template_exists {
my ($self, $file) = @_;
my $path = $self->config->template_path;
return 1 if grep { -e && -f && -r } map { "$_/$file" } @$path;
return;
}
- or download this
[% FOREACH thing = collection %]
[% template = factory.template_exists("list/types/${thing.type}.ht
+ml") ?
...
%]
[% INCLUDE $template %]
[% END %]