Subject: | propagate all TT config entries from Dancer's configuration to TT's |
Per discussion on dancer-users list[1]. This applies especially to
INCLUDE_PATH which is currently overridden unconditionally.
At least two possible approaches:
1. Simply replace
$tt_config->{INCLUDE_PATH} = setting('views');
with
$tt_config->{INCLUDE_PATH} ||= setting('views');
in Dancer::Template::TemplateToolkit
2. Prepend setting('views') to an INCLUDE_PATH provided by the user. In
this case the code is more complicated (INCLUDE_PATH may be a scalar or
an array) and along the lines of:
if($tt_config->{INCLUDE_PATH}) {
if(ref($tt_config->{INCLUDE_PATH}) eq 'ARRAY') {
unshift @{$tt_config->{INCLUDE_PATH}}, setting('views');
} else {
$tt_config->{INCLUDE_PATH} =
[setting('views'),$tt_config->{INCLUDE_PATH}];
}
} else {
$tt_config->{INCLUDE_PATH} = setting('views');
}
[1]
http://lists.perldancer.org/pipermail/dancer-users/2010-April/000112.html