On 10/11/2015 6:06 pm, Gabor Szabo wrote:
Is there a solution? If currently not,would it be possible to allow
views to be either a string or an array ref to strings?
Allowing views to be an arrayref of strings is likely to cause issues
with other template engines.
TT2 allows you to supply coderefs as part of its INCLUDE_PATH configuration.
(See Template::Manual::Config for the details). Configuring the template
engine within
your app may allow you to do what you want: eg ( warning - untested
config!! )
set engines => {
template => {
template_toolkit =>
INCLUDE_PATH => [ sub {
# code that returns absolute paths to your view dirs
map { path( app->location, $_) }
'views', app->request->var('other_views');
}],
...
}
};
set template => 'template_toolkit';
Hope that helps,
Russell.
_______________________________________________
dancer-users mailing list
[email protected]
http://lists.preshweb.co.uk/mailman/listinfo/dancer-users