Help for this page

Select Code to Download


  1. or download this
    if (template address exists) {
        include template
    } else {
        include other template
    }
    
  2. 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;
    }
    
  3. or download this
    [% FOREACH thing = collection %]
        [% template = factory.template_exists("list/types/${thing.type}.ht
    +ml") ?
    ...
        %]
        [% INCLUDE $template %]
    [% END %]