properly search the template path!! [#103]

This commit is contained in:
Oliver Gorwits
2014-06-23 20:35:30 +01:00
parent 5742bc7856
commit caedbdadc6
4 changed files with 28 additions and 5 deletions

View File

@@ -42,7 +42,7 @@ if (setting('extra_web_plugins') and ref [] eq ref setting('extra_web_plugins'))
}
# after plugins are loaded, add our own template path
push @{ config->{engines}->{template_toolkit}->{INCLUDE_PATH} },
push @{ config->{engines}->{netdisco_template_toolkit}->{INCLUDE_PATH} },
setting('views');
# workaround for https://github.com/PerlDancer/Dancer/issues/935

View File

@@ -21,7 +21,7 @@ set(
);
# this is what Dancer::Template::TemplateToolkit does by default
config->{engines}->{template_toolkit}->{INCLUDE_PATH} ||= [ setting('views') ];
config->{engines}->{netdisco_template_toolkit}->{INCLUDE_PATH} ||= [ setting('views') ];
register 'register_template_path' => sub {
my ($self, $path) = plugin_args(@_);
@@ -30,7 +30,7 @@ register 'register_template_path' => sub {
return error "bad template path to register_template_paths";
}
push @{ config->{engines}->{template_toolkit}->{INCLUDE_PATH} },
push @{ config->{engines}->{netdisco_template_toolkit}->{INCLUDE_PATH} },
dir($path, 'views')->stringify;
};